CJCoding With Joseph
15free / daySign inCreate account
Back to Code Walkthrough

Recursion Trace

C code walkthrough · Question 4
mediumFunctions

Code

Read carefully. What does this print?
1#include <stdio.h>
2 
3void countdown(int n) {
4 if (n <= 0) {
5 printf("Go!\n");
6 return;
7 }
8 printf("%d\n", n);
9 countdown(n - 1);
10}
11 
12int main() {
13 countdown(3);
14 return 0;
15}

Your answer