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