Menu
Question Index
...


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

Input (Integer) Output
6 *
# *
* # *
# * # *
* # * # *
# * # * # *
8 *
# *
* # *
# * # *
* # * # *
# * # * # *
* # * # * # *
# * # * # * # *
11 *
# *
* # *
# * # *
* # * # *
# * # * # *
* # * # * # *
# * # * # * # *
* # * # * # * # *
# * # * # * # * # *
* # * # * # * # * # *

class PrintFormationRightTriangle

{    public static void main(String s[])
    {
        printFormation(6);

    }


public static void printFormation(int size) {
//Write code here to print the required formation depending upon the columnsSize. Use System.out.println or System.out.print for printing.
}
}

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