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];     }

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
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
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education