Thursday, 21 February 2013

Return Statement



Return Statement is used for returning a value from function definition to calling function.

Syntax of Return Statement
return(expression);
     OR
return;

For Example:
return;
return a;
return(a+b);

Note that, data type of add is int and also the return type of function is int. the data type of expression in return statement should also match the return type of function.


No comments:

Post a Comment