A palindrome is a word that reads the same both forwards and backwards. Examples: anna, nitalarbralatin, amanaplanacanalpanama. Write a function that takes a string as parameter and returns true if the word is a palindrome, false otherwise. Also write a program palindrome.cc that reads words from the terminal and checks whether they are palindromes.
Jump to Post
Take the string and spell it in reverse. Compare the two strings, if they match you got a palindrome. Now show us some code!
All 13 Replies
We're a friendly, industry-focused community of 1.20 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.