Pyramid Program 2


Pyramid Program 2
 Output
----------
 1
 1 2
 1 2 3
 1 2 3 4
Pyramid Program 2
Source code
-------------
package com.swain.cell;

public class Piramid2 {

       public static void main(String args[]){
       int i,j;
       for(i=1;i<=4;i++)
       {
       for(j=1;j<=i;j++)
       System.out.print(" "+j);
       System.out.print("\n");
       }
       }
}

Comments

Popular posts from this blog

php format date string short month

curl service example in php