+ 1

wirte a program that will ask the user to enter a specific number and display them in a reverse order.

Example: enter number: 15 It reverse is: 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1

14th Dec 2022, 7:20 AM
Jeadrussel Cueto
Jeadrussel Cueto - avatar
1 Réponse
+ 4
Forge the loop to go backwards by setting loop counter to the given number, and decrement the loop counter while it's greater than zero - inside loop body, or in the loop construct, in case a for...loop was used.
14th Dec 2022, 8:27 AM
Ipang