CODE BOX
------------------------------------------------------------
/*program to print star pattern square box by while loop
5
54
543
5432
54321
*/
class npat8w
{
public static void main(String a[])
{
int n,i,j;
n=Integer.parseInt(a[0]);
i=n;
while(i>=1)
{j=n;
while(j>=i)
{
System.out.print(j);
j--;
}
System.out.print("\n");
i--;
}
}
}
------------------------------------------------------------
/*program to print star pattern square box by while loop
5
54
543
5432
54321
*/
class npat8w
{
public static void main(String a[])
{
int n,i,j;
n=Integer.parseInt(a[0]);
i=n;
while(i>=1)
{j=n;
while(j>=i)
{
System.out.print(j);
j--;
}
System.out.print("\n");
i--;
}
}
}
0 comments:
Post a Comment