Skip to the task
Layout
Back to classic view

You are looking at lesson 5. Your place is still lesson 4, task 1: Style.

CHECKTask 18 of 23 · step 7: Drills: check yourself

What does bounce(3) print?

What does bounce(3) print?

void bounce(int n) {
    if (n == 0) {
        return;
    }
    printf("%d ", n);
    bounce(n - 1);
    printf("%d ", n);
}
Stuck?

3 2 1 1 2 3. The first printf runs on the way down, the second on the way back, once the inner call has finished.