Java Program – to reverse a number using a while loop.

Output: