Function: – It is a soft content block which is used to perform specific task.
Advantage of function –
- Easy to maintain: – Solving our problem by using function we can maintain our program very easily.
- Reusability: – Once the function is created for group of statement (That a function holds), we can call or invoke any number of times as per our requirement. This term is called reusability because we are creating a function one but using again and again by calling that function for any number of times.
- Reduced program size: – By using function for executing group of statements for any number times, we can use function call technique. By this way, our program size will be reduce in order to reduce in order to execute group of statement for any number of times.
- Easy to debugging: – By using function we can locate our code in order to trace the flow of program.
- Easy to update: – As we know that function is use to perform specific task. Inside one program there can be any number of function. To perform their specific task. Show all the function each other are independent. If we need to update or change some part of code inside one function then remaining function will be unaffected.