Multiple choice technology programming languages

What will be the output of the below code snippet? public class Quiz9 { public static void main(String args[]) { int j = 0; for (int i = 0; i < 100; i++) j++; System.out.println(j); } }

  1. 99

  2. 100

  3. 0

  4. 101

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

The for loop iterates 100 times (i from 0 to 99). Each iteration increments j by 1, starting from 0. After the loop completes, j equals 100. This is a simple counter loop where the loop variable i controls the number of iterations.