Caffeinated Coder
Book an appointment
Lesson 05 · Basics

Functions

A function is a named block of code with typed inputs and a typed output. Follow one small program as main calls area(3, 4) and area(5, 2): watch each call get its own frame on the call stack, the arguments get copied into the parameters, and return carry one answer back to the line that asked. Then see the compiler reject a call with a missing argument before anything runs.

10 min10 steps5 questionsBeginner
Fig 5 · Interactive
Loading figure…
or ← →

Quiz Unlocks after the last step.