Multiple choice general knowledge science & technology

What will be the value of i when the loop terminates?? for ( i = 0; i < 11; i++) { System.out.println("count is : "+i); }

  1. 9

  2. 10

  3. 11

  4. 12

Reveal answer Fill a bubble to check yourself
C Correct answer
Explanation

In this Java for loop, i starts at 0 and increments while i < 11. The loop runs for i values 0, 1, 2, ..., 10. When i becomes 11, the condition i < 11 is false, so the loop terminates. At termination, i equals 11.