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
medium Solved by 2 students

Recursive Method Return Value

Mark
< Prev
Next >

Consider the following result method.

public int result(int n) 
{
    if (n == 1)
        return 2;
    else
        return 2 * result(n - 1);
}

What value is returned by the call result(5)?

A

32

B

2

C

16

D

8

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|