Menu
Question Index
...

What will be the output of the following program?

public class MyNumbersIs {
    public static void main(String[] args) {
        int number = 0;
        int number2 = 12;
        while (number < number2) {
            number = number + 1;
        }
        System.out.println("Number = " + number);
    }
}


Number = 0
Number = 11
Number = 12
Number = 13
Compilation Error or Runtime Error

Doubts

Problems

Topic: while Loop In Java

Read this topic
Take test on this topic

0
Wrong
Score more than 2 points

© meritcampus 2019

All Rights Reserved.

Open In App