Are you taking CLEP classes? Try clep.ai
| preferred AP College board partner for AP classes
AP Computer Science A/Unit 4: Iteration
Start Practice TestPractice Test
About Exam
easy Solved by 3 students

While Loop Output Prediction

Mark
< Prev
Next >

Which of the following code segments produces the output 987654321?

A

int num = 10;
while (num > 1) {
num–;
System.out.print(num);
}

B

int num = 0;
while (num <= 9) {
System.out.print(10 - num);
num++;
}

C

int num = 10;
while (num >= 1) {
num–;
System.out.print(num);
}

D

int num = 10;
while (num >= 0) {
System.out.print(num);
num–;
}

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

Question Leaderboard

Rank
User
Correct Count
Attempt Count
Total Time
Score
#1hitrishabhatia14 0m 00s 70
#2meromaroseif11 0m 49s 51
#3busemagngr12 1m 03s 27
Items per page:
10
1 – 3 of 3

AI Tutor

How can I help?

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