| preferred AP College board partner for AP classes
AP Computer Science A/Unit 10: Recursion
Start Practice TestPractice Test
About Exam
easy Solved by 1 students
Recursive Method Return Value
< Prev
Next >

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

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.

No comments yet. Be the first to comment!

AI Tutor

How can I help?

APFIVE © 2020.
Email: [email protected]|Privacy Policy