I am working on a program that is supposed to completely compress (basically eliminating punctuation and spaces and changing all letters to lower case) reverse a word or sentence that the user inputs and to determine if the reversed word is a palindrome. Additionally, the program should display the word/sentence in both compressed form and reversed form. Lastly, the program is supposed to ask the user if they would like to input another word, repeating if the answer is 'Y' or 'y' and closing the program if the answer is 'N' or 'n'.
I am currently able to reverse and display correctly individual words, but every time that I input a sentence the program closes.
Can anyone tell me what's going wrong?