| preferred AP College board partner for AP classes
AP Computer Science A/Unit 4: Iteration
Start Practice TestPractice Test
About Exam
easy Solved by 2 students
While Loop Output Prediction
< Prev
Next >

Which of the following code segments produces the output 987654321?

Which of the following code segments produces the output 987654321?

A

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

B

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

C

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

D

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

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