Recursive Method Tracing
What will be output as a result of the method call processNumber(5)?
Consider the following method processNumber.
public static void processNumber(int n) {
if (n <= 1) System.out.print(n);
else {
processNumber(n - 2);
System.out.print(n % 2);
}
}
What will be output as a result of the method call processNumber(5)?
A
101
B
100
C
001
D
111
Question Leaderboard
Not enough data yet to show leaderboard.
APFIVE