Use the vi editor to write a C program on the Sun cluster that prompts the user for an input file name. The input file should contain words (text) in any format. A word is defined as any string of characters separated from other strings of characters by one or more blanks, tabs, or newlines. Your program should read the first 100 words from the file (or the entire file if it contains less than 100 words) into an array of strings. Your program should then sort the array of strings alphabetically, write the sorted array to the screen, find the word that appears the most times in the array, and write this word and the number of times it appears to the screen. If there is a tie for the most frequent word, your program should output the most frequent word that appears earliest in the array. If the input file is empty, your program should indicate this and not output any frequency count.
More detailed specifications include:
~taw2/pub/prog8.c
gives an example of an array of
strings, and shows how to swap two strings in such an array.main()
.strcmp
from <string.h>
(see Appendix B of the text).