Menu
Question Index
...

What will be the output of the following program?

public class LoopFor {
    public static void main(String[] args) {
        int i = 0;
        for (; i < 3; i++)
            System.out.print(i + ", ");
            System.out.println(i);
    }
}


0, 0
1, 1
2, 2
0, 01, 12, 2
0, 1, 2, 3
Compilation Error
Runtime Error

Doubts

Problems

Topic: for 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