# Pyramid

Irwandi
Pyramid
Posted in : Java Beginners

Help me to write the following: 1 121 12321 1234321 123454321

May 30, 2011 at 12:50 AM

Help me to write the following

```           1
121
12321
1234321
123454321
```

thanks

May 30, 2011 at 10:19 AM

```class Pyramid{
public static void main(String[] args){
int x = 5;
for(int i = 1; i <= x; i++) {
for(int j = 1; j <= x - i; j++)
System.out.print("   ");
for (int k = 1; k <=i; k++)
System.out.print((k>= 10) ?+ k : "  " + k);
for (int k = i-1; k >= 1; k--)
System.out.print((k >=10) ?+ k : "  " + k);
System.out.println();
}
}
}
```

May 30, 2011 at 10:59 PM

i'm sorry if that more than 10 the pyramid become the right side... help me... thanks..

```                           1
1  2  1
1  2  3  2  1
1  2  3  4  3  2  1
1  2  3  4  5  4  3  2  1
1  2  3  4  5  6  5  4  3  2  1
1  2  3  4  5  6  7  6  5  4  3  2  1
1  2  3  4  5  6  7  8  7  6  5  4  3  2  1
1  2  3  4  5  6  7  8  9  8  7  6  5  4  3  2  1
1  2  3  4  5  6  7  8  910  9  8  7  6  5  4  3  2  1
```

pyramid
pyramid  hi frnds i need java code for pyramid. the pyramid look like this A BAB CBABC BAB
pyramid
pyramid  hi i need java code for pyramid. the pyramid look like this. A BAB CBABC BAB
pyramid
pyramid  how to print 1 22 333 4444 55555   class Pyramid { public static void main(String[] args) { for(int i=1;i<=5;i++){ for(int j=1;j<=i;j++){ System.out.print(i
pyramid
pyramid  How to get the code for the following pattern * * * * * * * * * *   class Pyramid{ public static void main(String args[]){ for(int i=1;i<=4;i
pyramid
pyramid  How to get the code for the following pattern * * * * * * * * * *   class Pyramid{ public static void main(String args[]){ for(int i=1;i<=4;i
pyramid
pyramid  how to get the output like this A BB CCC DDDD   Hi Friend, Try the following code: class Pyramid { public static void main(String[] args) { for(char ch1='A';ch1<='D';ch1
number pyramid
;class Pyramid{ public static void main(String args[]){ for(int i=1;i<=7...; class Pyramid{ public static void main(String args[]){ for(int i
Number Pyramid
for the following number pyramid: print.... So far I have this: print("import java.util.Scanner; class Pyramid { public... Pyramid { public static void main(String[] args) { Scanner input = new Scanner
nmber printed in pyramid format
nmber printed in pyramid format  how to print this format using java 1 23 345 4567 56789
Application for print pyramid of numbers
Application for print pyramid of numbers  What is the code for printing the numbers like 1 1 1 1 2 2 1 1 3 4 3 1 1 4 7 7 4 1
Java Pyramid of Numbers
Java Pyramid of Numbers  Hi, I want to know how the code to print the pyramid below works. It uses nested for loops. Pyramid: 1 2 1 2
PYRAMID - Java Beginners
will display triangle or pyramid... The user must choose A, B, or C...: A (so it will display a Pyramid OR TRIANGLE) would you like to continue y... OR PYRAMID NOTE: SORY I TRY TO DRAW A PYRAMID OR TRIANGLE BUT IT WILL NOT DISPLAY
Printing numbers in pyramid format - Java Beginners
Printing numbers in pyramid format  Q) Can you please tel me the code to print the numbers in the following format: 1... the following code: public class Pyramid{ public static void main (String
Pyramid Multiplex Online movie ticket booking
Pyramid Multiplex Online movie ticket booking  Pyramid multiplex.... Pyramid multiplex currently has 5 theatres now. Each theatre currently has... to browse through the movies running in Pyramid complex for any given date
how to make following pyramid using loop
how to make following pyramid using loop   1 212 32123 4321234 543212345 4321234 32123 212 1   Here is a code that displays the following pattern: 1 212 32123 4321234 543212345
loop code to print the Pyramid: 1 1234 12 123 123 12 1234 1
loop code to print the Pyramid: 1 1234 12 123 123 12 1234 1  Hi, I want to know how the code to print the pyramid below works. It uses nested for loops. Pyramid: 1 1234 12 123 123 12 1234 1
java loops - Java Beginners
java loops   Print the pyramid --------- * --------* * * * * * * * * * * * * * * * * * *   Hi friend, Use the following code: class Pyramid { public static
java loops - Java Beginners
java loops  Q1 print the following pyramid * * * * * * * * * * * * * * * * * * * *  ... to help in solving the problem : class Pyramid { public static void main
hi friend - Java Beginners
hi friend  ummm i want to know a java code ...what are the code if i want to display inverted pyramid(shape). i mean a pyramid is reversed down.... thank u friends!!!  Hi friend, Inverted pyramid code class
using array
using array  display 10 digit number using array and print pyramid. 1 1 1 1 1 1 1 1 1 1 1 1
loop example
loop example   1 1 2 1 2 3 1 2 3 4 1 2 3 4 5 can you give me the code to get the number pyramid
turbo C Question 5.
) like pyramid
c++ - Java Beginners
c++  2. Use for loops to construct a program that displays a pyramid of Xs on the screen. The pyramid should look like this X XXX XXXXX XXXXXXX XXXXXXXXX except that it should be 20 lines high, instead of the 5 lines shown
Tutorials