Functions turn one big program into small named pieces you can call again and again — inputs arrive as parameters, one value comes back.
1 Functions
A named block you can call from anywhere. Write it once, reuse it forever.
2 Parameters
The named inputs a function declares — the caller sends arguments that fill them.
3 Return value
return sends one value back to the caller and ends the call immediately.
4 Copies, not originals
C passes arguments by value: a function works on copies, so the caller's variables never change.
Divide and conquer
Functions1A named block you can call from anywhere. Write it once, reuse it forever. Parameters2The named inputs a function declares — the caller sends arguments that fill them. Return value3return sends one value back to the caller and ends the call immediately. Copies, not originals4C passes arguments by value: a function works on copies, so the caller's variables never change. 4 building blocks make up Divide and conquer
A call pushes a frame onto the stack; the return pops it back off.
process decision input / output start / end Two programs, two tabs — watch a value return from add(), then see why bonus() cannot touch the original score.
preprocessThe preprocessor pastes in stdio.h.
Memory
no variables yet — press play
Console
output appears as the program runs…
Two calls to the same function — what comes back each time?
Your predicted output — one line per console line
Hint: Each call runs the body fresh: triple(4) is 12, and triple(1) + triple(2) is 3 + 6.
Click a term, then click its meaning to lock the pair.
5 conceptsTap a card to expand ?parameterdrops into place
?argumentdrops into place
?returndrops into place
?voiddrops into place
?prototypedrops into place
01Functions turn big problems into small, named, reusable pieces.
02Arguments are copied into parameters — the caller's originals never change.
03return sends one value back and ends the call immediately.
04void means no return value; a prototype lets main call a function defined below it.
05Each call pushes its own frame on the stack — popped the moment it returns.