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 */
Subscribe to:
Post Comments (Atom)
We can simply make this prog as
i want to code for this
1 2 3 4 5
6 7 8 9
10 11 12
13 14
15
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
how to generate this pattern
1
0 1
1 0 1
0 1 0 1
need help, i cant find a program for this output using for loop
* ******
** *****
*** ****
**** ***
***** **
****** *
PS. is this a for loop generated output?
* *****
** ****
*** ***
**** **
****** *
really need the program for this output . .
is it a for loop ?
i want code for this
1
2 3
3 4 5
4 5 6 7
5 6 7 8 9
how to generate this pattern
1
2 3
3 4 5
can you make this pls...
------*
-----***
----*****
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......
how can i get this output pls
help me out
1
2 3
4 5 6
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
hi i need code for following:
*****
****
***
**
*
i want code for this
****
***
**
*
answer please..?