Skip to main content

Practice · 8 of 8

MCQ: What does `f(4)` return?

CHALLENGE
Difficulty: advanced+25 XP

What does f(4) return? ``java public static int f(int n) { if (n <= 0) { return 1; } return f(n - 1) + n; } `` A. 10 B. 4 C. 8 D. 11 Print your answer as: the option letter, then your explanation of why it is correct and why each other option is wrong. First line must start with the letter.

Back to lesson: Practice: MCQ set 1: read the misconception