Cognizant interview question

Write a code for reverse string