Question: A Palindrome is a word that is the same reading forward or backward. For example, each of the following words is a palindrome: Madam, Civic,
A Palindrome is a word that is the same reading forward or backward. For example, each of the
following words is a palindrome: Madam, Civic, Level. Noon, Refer, Wow. Note that the words are not
case-sensitive.
Write a C program that
Declare an array of twenty characters.
In a loop, get single characters from the user and store them in the array.
After user ends the inputs, check that the characters entered by the user creates a palindrome or
not and provide proper message like the sample execution provided.
Note: In this program, you are not allowed to use pointers and String functions. The only standard
functions you can use are toupper() and tolower() from the ctype library to convert a single character to
its corresponding uppercase or lowercase letters, respectively.
Sample Execution 1:
Enter a word as single characters:
Enter the EOF character to end the input.
Madam
Madam is a Palindrome.
Sample Execution 2:
Enter a word as single characters:
Enter the EOF character to end the input.
Adam
Adam is not a Palindrome.
Sample Execution 3:
Enter a word as single characters:
Enter the EOF character to end the input.
S
S is a Palindrome.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
