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
1 2 3
B
0 1 2
C
0 1 2 3
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 |
| #4 | bommasam000 | 1 | 1 | 35m 04s | -2,004 |
Items per page:
10
1 – 4 of 4
APFIVE