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

What is printed when the following code is executed?

public class LoopTest {
    public static void main(String[] args) {
        int count = 0;
        while(count < 3) {
            System.out.print(count + " ");
            count++;
        }
    }
}
A

1 2 3

B

0 1 2

C

0 1 2 3

D

Compilation Error

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
#1sgarv251311 0m 00s 100
#2y.seong202711 0m 12s 88
#3hitrishabhatia14 0m 00s 70
#4bommasam00011 35m 04s -2,004
Items per page:
10
1 – 4 of 4
No comments yet. Be the first to comment!

AI Tutor

How can I help?

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