Recursive Factorial Method Output
Consider the following fact method.
public static int fact(int n) {
if (n <= 1) return 1;
return n * fact(n - 1);
}
What value is returned by the call fact(5)?
A
120
B
24
C
Compilation Error
D
5
Question Leaderboard
Not enough data yet to show leaderboard.
APFIVE