When a program executes, it first finds main() and begins executing statements in the main() function block. Whenever a function call statement is encountered, a number of actions occur:
- If there are function parameters, the actual values found in the function call statement are assigned to the function parameter names.
- Program execution jumps to that function and begins executing statements in that function block.
- Execution continues until either a return statement is encountered or the end of the block is encountered (the closing }).
- Execution jumps back, or returns, to the calling function and resumes from that point.
If, in step 2, execution encounters another function call statement, the steps are repeated.
The following diagram illustrates the call/return order of execution when function calls are encountered. This order of execution cannot be violated. Since...