Menu
Question Index
...

What will be the output of the following program?

class PrintFormat
{
    public static void main(String[] args)
    {
        for (int i = 0; i < 5; i++)
        {
            for (int j = 5; j >= i; j--)
            {
                System.out.print(j);
            }
            System.out.println();
        }
    }
}


01234
1234
234
34
4
01234
01234
01234
01234
01234
543210
54321
5432
543
54
54321
5432
543
54
5
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