Functions
What is Function ? In a Program to perform articular task number of times which is having more number of statements, instead of writing those statements number of time we can define a sub routine called Function. The purpose of function is reusability. Function has three parts 1. Function declaration - before the main() 2. Function Calling - within the main() 3. Function Definition - after the main() Functions are following categories 1. Functions with no arguments, no return value 2, Functions with arguments, no return value 3. Function with arguments and return value while giving the function definition we can use as follows type specifier function_name(arg1,arg2,...) { statements; } In the above type specifier represent what type of value the function is going to return. If the function can't return any value we can represent with void otherwise we can use any related data type. to return the va...
Comments
Post a Comment