Question
Write a C program, , which counts the number of words, characters, and frequency of each character in the user provided sentence.Your program must: 1.Ask
Write a
C program,
, which counts the number of words, characters, and frequency of
each character in the user provided sentence.Your program must:
1.Ask user to enter a sentence (accept input until user hits enter). Assume that the sentence is no longer than 200 characters.
2.Count the number of words, assume that words are separated by a single space character
3.Count the number of characters and also the frequency of each character(including spaces and special characters) Do not display count for characters that dont exist in the
user input.
Example execution
s:
$ gcc -Wall
-o count count.c
$ ./count
Enter a sentence: Hello
Your sentence has 1 word(s)
Your sentence has 5 character(s)
Your sentence has 1 H
Your sentence has 1 e
Your sentence has 2 l
Your sentence has 1 o
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