class ReverseNumber {
public static void main(String[] args) {
def input = 123;
def temp, r, output = 0;
temp = input;
while (temp > 0) {
r = temp % 10;
temp = temp.intdiv(10);
output = output * 10 + r;
}
println("Original Number : " + input);
println("Reverse Number : " + output);
}
}