Lessons
C++ · Algorithm Foundations · 28. Recursion
step 1 of 7
A function calls itself
Recursion: a function that calls itself. countdown(3) prints 3, then asks countdown(2) to do the rest.
At 0 it says Go! and stops calling.
Mission
Start the countdown from 5, then RUN.
PIP·1
main.cppyour code
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
← press me!
Press RUN to see what this program does.