A function is a named recipe: inputs go in, a result comes back. main calls it, then continues.
A function is a named recipe with inputs and (often) a result. main calls it, the recipe runs, a value comes back, and main continues. The call stack is just “who is waiting for whom.”
call square(5)
n*n
back to main
25
Each step highlights the matching C line. Program output appears only when a line that prints actually runs.
Five questions. Pick one answer each, then Check answers. The correct choice turns green.
1. square(5) returns:
5*5.
2. After return, execution continues in:
Call then resume.
3. A void function:
void.
4. Why not put n*n only in main?
Decomposition.
5. A prototype is useful when:
Declare before call.