The return statement is used to return program control back to the main program.
Syntax
return (exp);
where ‘exp’ can be a constant, variable, or an expression. Even the parentheses around exp are
optional.
A return statement has two tasks:
1. It transfers control back to the calling program.
2. It returns a value after return to the calling program.
Please note that the return statement may not always be at the end of the called function.
There is no restriction on the number of return statements that are present in a function.
Do'stlaringiz bilan baham: |