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

What is the output produced by the following code?

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

Compilation Error

B

0 1 2 3

C

0 1 2

D

1 2 3

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