When a program invokes a routine, execution jumps from the calling code into the routine. The routine performs its task, and then execution returns to the point where the routine was called. Often, execution resumes with the calling code’s next statement, but sometimes, if the call to a routine is part of a complex statement, the same statement may continue to perform more tasks.
For example, if a program has defined the Factorial function described previously, then the following statement calculates 5! times 6!:
value = Factorial(5) * Factorial(6);
In this example, execution passes to the Factorial function to calculate 5!. When that function call returns, the code calls the function again to calculate 6!. When the second call returns, ...