Sunday, September 22, 2013

Filled Under: , , , ,

Number Pattern 5 by for loop

Share


Code Box by for loop
-----------------------

/*program to print star pattern square box by for loop

  54321
  54321
  54321
  54321
  54321
  

*/

class npat5
{
public static void main(String a[])
{
int n,i,j;

n=Integer.parseInt(a[0]);

for(i=1;i<=n;i++)
{
        for(j=n;j>=1;j--)
        {
        System.out.print(j);
        
}

System.out.print("\n");

}
}
}



0 comments:

Post a Comment