Print Number And Symbol Formation - Java Quiz Question


Write a program to print the following number and symbol formation depending upon input size. Use System.out.println or System.out.print for printing.

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



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

    }


    public static void printFormation(int size)
    {
    }

}