Question: write a C (not C++) program that will read in several strings (separated by spaces). These strings are on 2 lines. You will answer questions
write a C (not C++) program that will read in several strings (separated by spaces). These strings are on 2 lines. You will answer questions about each string.
Questions to answer: For the strings on the first line: Is this string a palindrome? (meaning is the same backwards and forwards examples are civic, level, radar.
What is the first character of the string?
What is the length of the string?
How many uppercase letters does this string have?
How many lowercase letters does this string have? For the strings on the second line:
Is this string a number?
If yes, is it an integer or a real number?
You must: Have functions for determining if a palindrome, if there are any uppercase characters in the string, if there are any lowercase characters in the string, if a string is a number, and what type of number is it (integer or real). Use strings.txt to get the input, but your program will read the strings in from stdin (You will use redirection to get the strings from the file. ./lab6 < strings.txt) Make your output print as: String is (not) a palindrome. Its first character is . It is of length . It has uppercase letters. It has lowercase letters. String is (not) a number. String is a . (to make sure there is blank line between each set of lines for these strings on the second line)
String.txt
radar leVel CompUtER Science theORY 100 string 98.56
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
