Question
B. The problem to be solved Write a C program to perform a menu driven program to display the following: 1. Display Content of a
B. The problem to be solved
Write a C program to perform a menu driven program to display the following:
1. Display Content of a file
2. Count Words
3. Count Characters
4. Exit
When 1 is chosen (Your program will read a text file and display it contents on screen. Your program should ask the file name from user. Note: You are not allowed to use Linux command to display the content of a file)
1. Display Content of a file
2. Count Words
3. Count Characters
4. Exit
Option: 1
Enter file name: file1.txt
The coronavirus (COVID-19) is currently affecting more than 150 countries worldwide and confining nearly 1 billion people to their homes, at the time of writing. During this difficult time, it is important that we support one another with additional love and understanding.
We cannot thank the essential services workforce enough for their sacrifice in the battle against COVID-19, but we can show them our appreciation by simply staying at home. After all, they stayed at work for us, so we SHOULD stay at home for them!
Staying at home may be difficult and frustrating, but there are things that you can do to make it easier
When 2 is chosen (Your program will display total words of your text file)
1. Display Content of a file
2. Count Words
3. Count Characters
4. Exit
Option: 2
No of words: 106
When 3 is chosen (Your program will display total characters of your text file)
1. Display Content of a file
2. Count Words
3. Count Characters
4. Exit
Option: 3
No of characters (including spaces): 624
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