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

Trending nowThis is a popular solution!
Step by stepSolved in 4 steps with 4 images

- in C program pleasearrow_forwardUse C++ languagearrow_forwardWrite a C program that requests a user's first name and last name. The maximum number ofcharacters in first name and last name is 50. The program must use the string "Enter your first name and last name: " to prompt the users Have it print the entered names on the first line and the number of letters in each name on the following line, as shown in the example below: Enter your first name and last name: Captain Africa Captain Africa 76 You need to specify the required lines of code in the answers. #include #include void main (void) { /* variable declarations */arrow_forward
- Simple C++ program, it's easy but I'm working on eight other things and I'm running out of time. To make telephone numbers easier to remember, some companies use letters to show their telephone number. For example, using letters, the telephone number 438-5626 can be shown as GET LOAN. In some cases, to make a telephone number meaningful, companies might use more than seven letters. For example, 225-5466 can be displayed as CALL HOME, which uses eight letters. Instructions Write a program that prompts the user to enter a telephone number expressed in letters and outputs the corresponding telephone number in digits. If the user enters more than seven letters, then process only the first seven letters. Also output the - (hyphen) after the third digit. Allow the user to use both uppercase and lowercase letters as well as spaces between words. Moreover, your program should process as many telephone numbers as the user wants. Use a dialpad for reference.…arrow_forwardthis is related to a c++ flowchart by the way also here is a hint or other things you need to do hint 1:You will need to use at least one loop of some sort. hint 2:Since you don't know how a computer could tell if you have successfully deciphered the text, you will need to ask a human (a.k.a. a user) for their input on whether the resulting text makes sense. also you need to use google docs for this work and can you please explain each post very well thank you i would really appreciate itarrow_forwardPlease help me solve this problem C. Chess Boundary Positions: Write a program called chess_pos.py On a chessboard, positions are marked with letters between a and h for the column and a number between 1 and 8 for the row. Give a 2 character input string with a letter (a-h) and a number (1-8), print "Corner" if the value indicates a square on a corner. Print "Border" if the value indicates a square on an edge of the board. Otherwise, print "Inside".arrow_forward
- Database System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSON
- C How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill Education





