| 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
Tracing a Recursive Method
< Prev
Next >

What value does result(5) return?

Refer to the method result:

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

What value does result(5) return?

A

16

B

32

C

2

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.

No comments yet. Be the first to comment!

AI Tutor

How can I help?

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