Answered step by step
Verified Expert Solution
Question
1 Approved Answer
7. Write a C program that takes as input two lines of text, each ended by the newline character ' '. It then outputs
7. Write a C program that takes as input two lines of text, each ended by the newline character ' '. It then outputs "YES" if they contain the same number of occurrences as each other of each of the 26 letters in the alphabet, and "NO" otherwise. The program should ignore all input characters that are not letters and should not distinguish between lower and upper case. Use the get char-function from and the isalpha- and toupper-functions from . For example, if the input is "William Shakespeare! " and "I'll make a wise phrase. " then the output of your program should be "YES". Hint: To use an upper-case letter stored in a variable named ch as an index in an array named frequency, you can write frequency [ch- 'A']. (3 marks)
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Heres a simple C program that fulfills the given requirements c in...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