Simple Pattern in Java-3

//Java Program displaying a simple pattern

Pattern3.java

 Pattern to display is

*****

****

***

**

*


public class Pattern3
{
	 public static void main(String args[]){

		 for(int i=5; i>=1; i--){

			 for(int j=1; j<=i; j++){
				 System.out.print("*");
			 }//inner for
			 System.out.println();

		 }//outer for

	 }
}

Advertisements

2 thoughts on “Simple Pattern in Java-3

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s