Question d’entretien chez J.P. Morgan

How to print reverse integer and string?