Code Box by for loop
---------------------------
/*program to print star pattern square box by for loop
55555
44444
33333
22222
11111
*/
class npat6
{
public static void main(String a[])
{
int n,i,j;
n=Integer.parseInt(a[0]);
for(i=n;i>=1;i--)
{
for(j=1;j<=n;j++)
{
System.out.print(i);
}
System.out.print("\n");
}
}
}
0 comments:
Post a Comment