Saturday, July 31, 2010

Program On Pattern

Few days back I got one comment to design a pattern using program that will will looks like:

7654321
66
55
44
33
22
11

I forgot to publish the comment. Anyway here is the codings of the program.

class BlueJ
{
int i,j,x;
public void show()
{
x=7;
for(i=0;i<7;i++)
{
for( j=0;j<7;j++)
{
System.out.print(x+" ");
if (i==0)
x--;
else if(i!=0 && j==1)
break;

}
System.out.println();
x=7-i-1;
}
}
}

Related PostBlueJ Programs On Pattern

No comments:

Post a Comment

Subscribe via email

Enter your email address:

Delivered by FeedBurner