FUNCTION PROTOTYPE – DEFINITION

function prototype – definition

Function prototype is the declaration of a function which specifies about the return type,function name as well as the data types of the parameters that are passed to the function.

General syntax of function prototype

returntype function name(data type parameter1,data type parameter ,……data type parameter n)

int factorial(int number)

Function definition is the actual body of the function which specifies the actual task or the body of the function.

int factorial (int number)

{

int fact =1;

for(int i=1;i<=number;i++){

fact*=i;

}

return fact;

}

This entry was posted in Basic. Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *