Pallindrome program

i have made this code and gives perfect output but my task seems to fail …why?