import java.util.*; public class ReverseNumber { public static void main(String[] args) { Scanner console=new Scanner(System.in); int num; int digit; System.out.println("Enter an integer number"); num = console.nextInt(); System.out.println("The reverse order of this number is "); while(num > 0) { // The rightmost digit = the number % 10 digit = num % 10; // Print the rightmost digit System.out.print(digit); // number = (number – the rightmost digit ) / 10 // num = (num - digit) / 10; // A better way to update the num num = num / 10; } } }