Recursive Method Return Value
Consider the following recursive method.
public static int transform(int n)
{
if (n <= 1) {
return 1;
}
return n * transform(n - 2);
}
What is the value returned by the call transform(5)?
A
20
B
5
C
15
D
10
Question Leaderboard
Not enough data yet to show leaderboard.
