Question: using terminal command line , can anyone help 6. Write a C program that reads a sentence from the keyboard until a newline character is

using terminal command line , can anyone help

using terminal command line , can anyone help 6. Write a C

6. Write a C program that reads a sentence from the keyboard until a newline character is met (i.e., Enter' button from the keyboard is pressed). Next, the user is asked to type any alphabet and the program will count the number of occurrences of that particular alphabet in the sentence. The program will ignore case in alphabets (i.c., uppercase or lowercase). For example, if the user types "Hello World" and wants to look for the number of occurrences of 'O' o in the sentence, the program will generate the following output. 8 pts ype&sentence ello World!!! ype a character that you'd like to find the number of occurrences in the sentence: lphabet o haa a frequency of 2 CSCD204S Consider the following C code countChar.c. The comments in code show the steps you need to write to make the code work. #include define MAXSIZE 100 in cha ence coun int i; char sentence [MAXSI2E] int alphabetsCount0; printf("Type a sentence: In") // write the code that reads a sentence from the keyboard 2pts printf("Type a character that you'd 1ike to find the number of occurrences in a sentence: " // write the code that reads a character from the keyboard 2 pts // write the code that counts the number of character in the sentence; 2 pts // ignore uppercase or lowercase 2 pts printf ("Alphabet ic has a frequency %d ", ch, alphabetsCount); return 0

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!