Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

image text in transcribed

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Modeling And Design

Authors: Toby J. Teorey, Sam S. Lightstone, Tom Nadeau, H.V. Jagadish

5th Edition

0123820200, 978-0123820204

More Books

Students also viewed these Databases questions

Question

=+(2,7", P+ ) is the completion of (, , P).

Answered: 1 week ago

Question

b. Explain how you initially felt about the communication.

Answered: 1 week ago