Write a C program that gets user input as a string and determines if the given string is a  palindrome (the same when spelt forwards or backwards). Examples of palindromes  (ignoring case, punctuation and spaces) are: civic Race car Madam, I’m Adam. A man, a plan, a canal, Panama. We need to check if a word or phrase that may contain uppercase letters, lowercase  letters, spaces, and punctuation marks. For example, race car is not a palindrome  because 'e' is not the same as ' ' and Racecar is not a palindrome because 'R' is not the  same as 'r'. To solve this problem, write a function lettersOnlyLower that, given a  string phrase, converts all letters to lowercase and removes all spaces and non-letters.  To find out if the given word or phrase is a palindrome, write a function called palindrome, which, given a string word, returns 1 if word is a palindrome and 0 if it is  not. Note that if the user hit enter without typing any word or phrase, exit the program. Use the following example code below to write your code. lettersOnlyLower function uses two char pointers as its arguments and palindrome function uses a char pointer. So,  pass your values accordingly. #include #include #include void lettersOnlyLower(char *phrase, char *word); int palindrome(char *word); int main(int argc, char* argv[]) {  char aPhrase[100], aWord[100];     }

C++ for Engineers and Scientists
4th Edition
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Bronson, Gary J.
Chapter9: Completing The Basics
Section: Chapter Questions
Problem 3PP: (Program) Write a C++ program that accepts a string from the user and then replaces all occurrences...
icon
Related questions
Question

Write a C program that gets user input as a string and determines if the given string is a 
palindrome (the same when spelt forwards or backwards). Examples of palindromes 
(ignoring case, punctuation and spaces) are:
civic
Race car
Madam, I’m Adam.
A man, a plan, a canal, Panama.
We need to check if a word or phrase that may contain uppercase letters, lowercase 
letters, spaces, and punctuation marks. For example, race car is not a palindrome 
because 'e' is not the same as ' ' and Racecar is not a palindrome because 'R' is not the 
same as 'r'. To solve this problem, write a function lettersOnlyLower that, given a 
string phrase, converts all letters to lowercase and removes all spaces and non-letters. 
To find out if the given word or phrase is a palindrome, write a function called
palindrome, which, given a string word, returns 1 if word is a palindrome and 0 if it is 
not.
Note that if the user hit enter without typing any word or phrase, exit the program.
Use the following example code below to write your code. lettersOnlyLower function uses
two char pointers as its arguments and palindrome function uses a char pointer. So, 
pass your values accordingly.


#include <stdio.h>
#include <string.h>
#include <ctype.h>
void lettersOnlyLower(char *phrase, char *word);
int palindrome(char *word);
int main(int argc, char* argv[]) {
 char aPhrase[100], aWord[100];
 
 
}

Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 4 steps with 4 images

Blurred answer
Knowledge Booster
Problems on Dynamic Programming
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr