Posted by : Unknown Thursday, 11 June 2015

class pattern
{
public static void main(String args[])
{
int count=1;
for(int i=1;i<=9;i++)
{
for(int j=1;j<=count;j++)
{
System.out.print("*");
}
System.out.println();
if(i<5)
{
count=count+1;
}
else
{
count=count-1;
}
}
}
}

Output:

Leave a Reply

Subscribe to Posts | Subscribe to Comments

Welcome to My Blog

Translate

Popular Post

Total Pageviews

Blog Archive

- Copyright © Learning Java Program - Powered by Blogger -