Menu
Question Index
...

What will be the output of the following program?

public class YZ {
    public static void main(String args[]) {
        int z = 0;
        for (int y = 0; y >= z; ++y, z++) {
            System.out.print(y + "~");
            System.out.println(z);
        }
    }
}


0~0
Goes to infinite loop
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