#Pyramid... question.-->

1 messages · Page 1 of 1 (latest)

pine jungle
#

1
21
321
4321
54321....
I can make pyramid but couldn't Reverse print it... I only managed to do this...
1
12
123
1234
12345
P.S(I am a newbie)#pyramid

tough hullBOT
#

<@&987246683568103514> please have a look, thanks.

#

You can use </chatgpt:1108714622413963314> to ask ChatGPT about your question while you wait for a human to respond.

brittle grove
#

You can print a varying number of spaces in front of each line.

#

The number of spaces gets smaller as the line gets longer.

#

Or you can use formatted output that has left-padding built in.

#

eg...

   for (int i = 1; i <= 5; i++) {
       System.out.printf("%5s%n", "*".repeat(i));
   }

But it's unlikely this is what would be expected in a course exercise.