Cognizant interview question

string reversal program