Write a C program that opens a text file called numbers.txt for reading. The file contains a
Question:
Write a C program that opens a text file called numbers.txt for reading. The file contains a sequence of integers all separated by new lines. Your program should read all of the numbers in the file and output the following information: A count of the number of integers read. The sum of all the integers in the file. The smallest integer in the file. The largest integer in the file. The average of all the numbers.
I ran the program with the following input file.
7
4
3
5
-20
1
9
87
32
41
9001
File location: To test your program, you can use an absolute path (full path) for the text file like what I had in the class. When you submit your program, just use ?numbers.txt? (remove any path information) in fopen function. If you know the location of your executable program, you can copy the numbers.txt file to that directory. Your program output should look something like the following: