Infosys interview question

Code to reverse a number