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

Consider the following processNumber method.

public static void processNumber(int n) {
    if (n <= 1) {
        System.out.print(n);
    } else {
        processNumber(n - 2);
        System.out.print(n % 2);
    }
}

What is printed to the console as a result of the call processNumber(5)?

A

101

B

111

C

100

D

001

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

Question Leaderboard

Rank
User
Correct Count
Attempt Count
Time
Score
#1ajcantuwilson032511 2m 12s -32
#2tellabhinaya01 1m 31s -101
#3singhris00011 3m 49s -129
Items per page:
10
1 – 3 of 3
No comments yet. Be the first to comment!

AI Tutor

How can I help?

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