Terminates the execution of a function and returns control to the calling function (or to the operating system if you transfer control from the main function). Execution resumes in the calling function at the point immediately following the call
// Single return at end often improves readability.
int max(int a, int b) {
int maxval;
if (a > b) {
maxval = a;
} else {
maxval = b;
}
return maxval;
}//end max
// Multiple return statements often increase complexity.
int max(int a, int b) {
if (a > b) {
return a;
} else {
return b;
}
}//end max
void displayNumber() {
// code
}