Published On: Wed, Apr 6th, 2011
JAVA | By atul

Java Program For Pyramid Of Numbers

Share This
Tags

Pyramid Sequence

1
1 2
1 2 3
1 2 3 4

class Pyramid1
{
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”);
}
}
}

/********* OUTPUT ********
1
1 2
1 2 3
1 2 3 4 */

Leave a comment

XHTML: You can use these html tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>