#Pyramid... question.-->
1 messages · Page 1 of 1 (latest)
<@&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.
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.