Are you taking CLEP classes? Try clep.ai
| preferred AP College board partner for AP classes
AP Computer Science A/Unit 10: Recursion
Start Practice TestPractice Test
About Exam
easy

Recursive Method Return Value

Mark
< Prev
Next >

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

Hint
Did You Know?
Explain Why
Explain All Answers
Check Answer
Show Correct Answer
Report Question

Question Leaderboard

Not enough data yet to show leaderboard.

AI Tutor

How can I help?

APFIVE © 2020.
Email: apfive@apfive.org|Privacy Policy|