Chubb Interview Question

The interviewers also asked me to write a program to reverse a number.