Computer Science, asked by ritamali1221, 7 months ago

write a program in Java to print the following output (use switch case).
(1).

1
11
121
1331
14641

(2)
7654321
654321
54321
4321
321
21
1

Answers

Answered by leontom9982
0

Answer:

There is a relationship between x in your code, and the number of spaces you need to print. Specifically, the number of spaces to print is:

spaces = 5 - x;

So, before you print the numbers, print that many spaces.

Follow me on YouTube@ Gamer Boy05

Similar questions