Answered step by step
Verified Expert Solution
Question
1 Approved Answer
In C language This program reads in a series of words. All words consist of only lower-case letters ('a' through 'z'). None of the words
In C language
This program reads in a series of words. All words consist of only lower-case letters ('a' through 'z'). None of the words entered will be longer than 50 letters. The program reads until ctrl-d (end-of-file), and then prints out all the lower-case letters that were missing in the input or a statement indicating the input has all the letters. Two executions of the program are shown below.
Enter your input: the quick brown fox jumps over the lazy old dog Your input contains all the letters
Enter your input: alabama crimson tide Missing letters: f g h j k p q u v w x y z
Hints:
- Use an array of 26 elements to store the number of times you have seen the characters 'a' through 'z'. 'a' is actually an integer of value 97 (its ASCII value). If you subtract 'a' (or 97) from a lower-case letter, you will get a number in the range of 0 to 25.
- To test this program, it is a good idea to create a file (input1.txt for example) to contain all the input words. Then test the program with input redirection: ./a.out < input1.txt (or ./a.exe < datafile). Make sure the input file ends with a newline.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started