While Loop Output
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
0 1 2 3
B
1 2 3
C
0 1 2
D
Compilation Error
Question Leaderboard
| Rank | |||||
|---|---|---|---|---|---|
| #1 | sgarv2513 | 1 | 1 | 0m 00s | 100 |
| #2 | y.seong2027 | 1 | 1 | 0m 12s | 88 |
| #3 | hitrishabhatia | 1 | 4 | 0m 00s | 70 |
APFIVE