Cognizant interview question

write string reversal program