Loading....
Coupon Accepted Successfully!

 

C- Programming

Function

Functions are used to provide modularity to the software. By using functions, you can divide complex tasks into small manageable tasks. The use of functions can also help avoid duplication of work. For example, if you have written the function for calculating the square root, you can use that function in multiple programs.

Syntax of function

Arguments list

Function header

Function (argl, arg2, arg3)

type argl, arg2, arg3 Arguments declarations

{

statement 1;

statement2;

statement3; Function body

statement4;

}

Division

The general format of a function is

{

executable statements;

Return (expression);

}

Example:
int f1 (int j, float f)
{
int k;
k = l;

return (k);
}

 





Test Your Skills Now!
Take a Quiz now
Reviewer Name