What will be the output of the following while loop?
int x = 10;
while (x > 0) {
x -= 3;
System.out.print(x + " ");
}
7 4 1 -2
10 7 4 1
10 7 4 1 -2 -5
Infinite loop
This question is part of this quiz :
Java Control Statements and Loops