Problem:
Question- Write a program that reads in the name of a file and prints out the number of characters, words, and lines in the document. Include the end-of-line character in the number of characters. A word is any sequence of characters that is delineated by a space or end-of-line character.
Suppose the file td.txt contains the following data. There is no end-of-line character in the fourth line.
abcd efgh ijkl
mn op qrst uv
wx y z 0 1 23
45 67 89
The program works as follows:
Enter document name: td.txt
4 16 51
Show the code, demonstrate it works properly and describe what it is doing.