Multiple choice technology programming languages

Given: 25.intx=12; 26. while (x < 10) { 27. x--; 28. } 29. System.out.print(x); What is the result?

  1. 0

  2. 10

  3. 12

  4. Line 29 will never be reached.

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

The variable x is initialized to 12. The while loop condition (x < 10) evaluates to false immediately, so the loop body never executes. The program prints the initial value of x, which is 12.