Recursive Method Return Value
Consider the following recursive method.
public static int papaya(int x, int y) {
if (x <= 1) {
return y;
} else {
return papaya(x - 3, y + x);
}
}
What value is returned as a result of the call papaya(10, 5)?
A
36
B
26
C
22
D
15
Question Leaderboard
Not enough data yet to show leaderboard.
APFIVE