0

Make a program to accept any word of 5 characters and print palendrome

17th Nov 2016, 5:16 PM
rashmi bansal
rashmi bansal - avatar
2 odpowiedzi
+ 2
think of first defining a function to compute whether a word is a palindrome. it's quite easy if you consider it being a recursive function. then you could reuse the function for words of any size
17th Nov 2016, 6:09 PM
Álvaro
0
I have a palindrome program on my profile you could use as a starting point and modify it to only take words of 5 characters in length (using an if statement to make sure MyString.length () == 5). If the length returned is something other than 5, you can re-prompt the user for a string 5 characters long.
17th Nov 2016, 6:00 PM
scott johnson
scott johnson - avatar