Menu
Question Index
...

Write a program to print the following formation depending upon size of the matrix. Use System.out.println or System.out.print for printing.

Input (Integer) Printed Output
4
2 2 
3 3 3 
4 4 4 4
7
2 2 
3 3 3 
4 4 4 4 
5 5 5 5 5
6 6 6 6 6 6
7 7 7 7 7 7 7
for eg. if the input is 4 it should print for eg. if the input is 5 it should print



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