CJCoding With Joseph

Reverse a Number

Read a positive integer n from standard input and print its digits reversed. For example, if the input is 123, print:

Reversed: 321

Build the result with the % 10 and / 10 operators inside a loop. Leading zeros disappear (so 5040 becomes 405).

Expected Output:

Reversed: 321
Topics:
User Input
๐Ÿ“ฅ Auto-Input:
123\n
This input is automatically fed to your program's stdin
Code Editor
1
Tab to indent ยท Ctrl+Enter to run ยท Ctrl+Space to expand shortcuts (sysout, psvm, fori)

Your Output

Run your code to see the output here...

Test Cases

Run your code to see test case results.