Java Program For Pyramid Of Numbers 2

15 comments - Post a comment

Pyramid Sequence
5
5 6
5 6 7
5 6 7 8


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

/********* OUTPUT ********
5
5 6
5 6 7
5 6 7 8 */

 
This Post has 15 Comments Add your own!
Anonymous - July 31, 2009 at 3:07 PM

We can simply make this prog as

En.Chain - December 16, 2010 at 6:44 PM

i want to code for this


1 2 3 4 5
6 7 8 9
10 11 12
13 14
15

Unknown - January 5, 2011 at 11:17 PM

how to generate this pattern

A B C D E F G F E D C B A
A B C D E F F E D C B A
A B C D E E D C B A
A B C D D C B A
A B C C B A
A B B A
A A

Anonymous - January 29, 2011 at 9:32 AM

how to generate this pattern

1
0 1
1 0 1
0 1 0 1

jmdeoampo - August 25, 2011 at 4:58 AM

need help, i cant find a program for this output using for loop
* ******
** *****
*** ****
**** ***
***** **
****** *
PS. is this a for loop generated output?

jmdeoampo - August 25, 2011 at 5:00 AM

* *****
** ****
*** ***
**** **
****** *
really need the program for this output . .
is it a for loop ?

java code - August 25, 2011 at 10:44 AM

i want code for this
1
2 3
3 4 5
4 5 6 7
5 6 7 8 9

java code - August 25, 2011 at 10:45 AM

how to generate this pattern
1
2 3
3 4 5

Anonymous - November 16, 2011 at 5:05 AM

can you make this pls...

------*
-----***
----*****

Denkar - December 21, 2011 at 12:14 PM

it seem so interesting but if you could explain those examples line by line then the readers like me can understand it in a more depth......

suji - January 18, 2012 at 4:45 PM

how can i get this output pls
help me out
1
2 3
4 5 6

Anonymous - March 7, 2012 at 12:52 PM

i need code for this in java

------------1
----------1 2 1
--------1 3 3 1
------1 4 6 4 1
----1 5 10 10 5 1

preeti - March 22, 2012 at 9:51 PM

hi i need code for following:
*****
****
***
**
*

preeti - March 22, 2012 at 9:52 PM

i want code for this
****
***
**
*

maizkie - June 26, 2012 at 5:27 PM

answer please..?

Post a Comment