Question: 1. This project helps you explore some functions from the ctype.h library. It also helps you master opening,closing and reading from files. You will use

1. This project helps you explore some functions from the ctype.h library. It also helps you master opening,closing and reading from files. You will use functions such as ispunct(), isalpha() etc. from this library. Write a C program that can open and read any user provided text file (Ask user for file name). If you wish, you may read the file line by line or character by character. Then print out the number of occurrences of each of the vowels a, e, i, o and u in the text, the total number of consonants, the total number of punctuations and and then print out each of these items as a % of the total number of characters in the files (ignore blank spaces and any new line characters). Also output these values into a file called output.txt. Desired output format is as follows (the numbers in the output below are just being used as an example): Percentages of various characters: a 10% ; e 4% ; i 3% ; o 4% ; u 0% ; consonants 67% ; punct 12%

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!