Menu
Question Index
...

What will be the output of the following program?

public class SandCement {
    public static void main(String[] args) {
        for (int i = 0; i < 10; i *= 3) {
            System.out.print(i + ":");
            for (i = 6; i < 14; i += 2) {
                System.out.print(i + ":");
            }
        }
    }
}


0:6:8:10:12:
6:8:10:12:
6:9:12:
Some other output or Compilation Error

Doubts

Problems

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