Menu
Question Index
...

Write a program to print the following formation depending upon size of the matrix. Spaces between numbers are also important. Use System.out.println or System.out.print for printing.

Input (Integer) Printed Output
4 1 2 3 4
1 2 3 4
1 2 3 4
1 2 3 4
5 1 2 3 4 5
1 2 3 4 5
1 2 3 4 5
1 2 3 4 5
1 2 3 4 5



class PrintFormation
{
    public static void main(String s[])
    {
        printFormation(5);

    }


    public static void printFormation(int size)
    {
    }

}

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