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.
corolaron
0
Newbie Poster
Recommended Answers
Jump to PostTry searching the forum.
Jump to Postwhy should I write such a program?
Jump to PostTake the string and spell it in reverse. Compare the two strings, if they match you got a palindrome. Now show us some code!
Jump to Posttry this logic...
You know a word isn't a palindrome if it's an odd number of characters."dad" is a palindrome.
All 13 Replies
SpS
34
Posting Pro
jwenting
1,889
duckman
Team Colleague
vegaseat
1,735
DaniWeb's Hypocrite
Team Colleague
joshuatree
0
Newbie Poster
Rashakil Fol
978
Super Senior Demiposter
Team Colleague
jwenting
1,889
duckman
Team Colleague
brahle
0
Newbie Poster

iamthwee
brahle
0
Newbie Poster
jwenting
1,889
duckman
Team Colleague
bumsfeld
413
Nearly a Posting Virtuoso
jwenting
1,889
duckman
Team Colleague
gkmishr1
0
Newbie Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.