Last Updated: 17 August, 2022
On this tutorial page we are going to learn how to write a Java program to reverse a number. For example, if we input a number 246810 then will get 018642 as a reverse number.
In the given program we are reversing a number using for loop and while loop. Let's see the implementation.
Output
The Original Number: 12345
The Reversed Number: 54321
Output
The Original Number: 12345
The Reversed Number: 54321
Output
Enter the number: 987654321
The Reversed Number: 123456789
That's all guys, hope this Java Program is helpful for you.
Happy Learning... 😀
feedback@javabytechie.com