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 2 students

While Loop With Compound Condition

Mark
< Prev
Next >

What is printed as a result of executing the following code segment?

public class Main {
    public static void main(String[] args) {
        int x = 0;
        int y = 5;
        while(x < 3 && y > 2) {
            System.out.print(x + " ");
            x++;
            y--;
        }
    }
}
A

1 2 3

B

Compilation Error

C

0 1 2 3

D

0 1 2

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|