pattern in java,java pyramid program

 How to make pattern in java.java Pattern programing

In this article we are going discuss about make a star pattern using java programming.

Code:

 

class pattern

 {

  public static void main(String[] args)

     {

        int rows = 5;

        for(int i = 1; i <= rows; ++i)

         {

            for(int j = 1; j <= i; ++j) 

            {

                System.out.print("*");

            }

            System.out.println();

        }

    }

}


Output:

*

**

***

****

*****

 

                 Thank You?

0 K comment

Post a Comment

Iklan Atas Artikel

Iklan Tengah Artikel 1

Iklan Tengah Artikel 2

Iklan Bawah Artikel