1. Engineering
  2. Computer Science
  3. c program accept an input file name from the user...

Question: c program accept an input file name from the user...

Question details

c++ program

Accept an input file name from the user. If the input file can not be opened, display an appropriate message and end the program.

For each distinct word in the file, count the number of times each word appears in the file.

Display the list of words (and their counts) in order of descending count. In other words, the most frequent word (with the largest count) should be displayed first, followed by the second-most frequent word, and so forth. The least frequent word should be displayed last. There may be some cases where more than one word has the same count, and in these cases you should display the words in alphabetical (ASCII) order.

Solution by an expert tutor
Blurred Solution
This question has been solved
Subscribe to see this solution