Neudesic Interview Question

Write a program to reverse a number and explain the logic