Cognizant interview question

I had to write a palindrome program