Tuesday, December 11, 2012

Java Program To Print Pattern 6


Java Program To Print Pattern 6


class pat_6
{
public static void main(String args[])
{
for(int i=4;i>=1;i--)
{
for(int j=4;j>i;j--)
{
System.out.print(" ");
}
for(int k=1;k<=2*i-1;k++)
{
System.out.print("*");
}
System.out.println();
}
}
}

Java Program To Print Pattern 6
OUTPUT

No comments:

Post a Comment