int i = 0;
while (i < 10) {
System.out.println(i);
}What problem does this loop have?
- A
It prints 0 through 9
- B
It prints 1 through 10
- Ccheck_circle
Infinite loop; i is never incremented
- D
Compile error: missing braces
Explanation
Without i++ inside the loop body, the condition i < 10 is always true, so the loop runs forever printing 0.