A function is a sequence of statements to perform a specific task and it can be called by other functions. A function may take some input and perform a logical unit of task and may return the response to calling function.
Interesting Facts About Functions in C
Advantage of Functions in C Programming language
Components of a function in C
-Function name : This is a C identifies representing the name of the function. Every function must have a unique name in a C program. Name of a function is used to call a function.
type arg1, type arg2 ..... : It is a comma-separated list of data types and names of parameters passed by the calling function. The parameter list contains data type, order, and number of the parameters expected by a function at the time of calling it. Function Parameters field is optional, we can skip it if a function don't require any data from calling function.
body of a function : The body of a function contains a set of statements that will be executed when this function is called. It may define it's own local variables and call other functions.
return(expression) : This is used to send a value to calling function before termination of function. If the return type of function is void, you need not use this line. When control reaches return statement, it halts the execution of function immediately and returns the value of expression to calling function.