Rohit Group interview question

Reverse a string when user enters it