While Loop With Compound Condition
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
Question Leaderboard
Not enough data yet to show leaderboard.
APFIVE