Cognizant Interview Question

Write down the code to reverse a string.