Cognizant interview question

Write down the code to reverse a string.