User Defined Function
User Defined Function
The functions which are designed by programmer on the basis of their requirement. main( ) is a
user defined function, and it is the starting point of execution of a program.
Note: Function prototypes enable the compiler to verify that functions are called correctly. The
compiler ignores variable names mentioned in the function prototype.
Implementation of the function or writing the task of the function Type of the value returned to
the calling function
Executable statements
return statement
Return type
Executable statements
return statement
}
In this type, there is no data transfer between the calling function and the called function.
But there is flow of control from the calling function to the called function and back
In this type, there is no data transfer between the calling function and the called function. But
there is data transfer from the called function to the calling function..
Functions with parameters and no return value
In this type, there is data transfer between the calling function and the called function. But there
is no data transfer from the called function to the calling function
In this type, there is data transfer between the calling function and the called function. When the
parameter passed, the called function can receive data from calling function. When returns a
value, the calling function can receive from the called function.
Functions with multiple return values
In general, a function can rerun at most one value only. But when we use call by reference, we
can return multiple values(That is, we can modify multiple variables)