Cognizant interview question

Code for reversing a number