Cognizant interview question

Program for string revrsal