->User defined functions are self-contained blocks of
statements which are written by the user to compute or
perform a task.
->They can be called by the main program repeatedly as
per the requirement.
->In order to make use of user-defined functions,
we need to establish three elements that are
related to functions.
1.Function declaration
2.Function Call
3.Function definition
Syntax:
function_type function_name(arguments list);
Ex.
int add(int , int);
->The program that calls the function is referred to as the
calling program or calling functions
Syntax:
function_name(actual parameters);
Ex. add(a,b);
->The function definition is an independent program module that is
specially written or implement the requirements of the function.
Ex:
main()
{
function1();
…. function2();
}
function1()
{
…
}
function2()
{
… function1();
}
1.Function with no arguments &
no return value.
2.Function with arguments & no
return value.
3.Function with arguments &
return one value.
4.Function with no arguments &
return one value.
5.Function return multiple
values.
user defined functions in c language

user defined functions in c language