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