#include <stdio.h>
int
main (void)
{
int number, sum, count;
double average;
FILE *in;
in = fopen ("numbers.data", "r");
sum = 0;
count = 0;
while (fscanf (in, "%d", &number) != EOF)
{
sum = sum + number;
count = count + 1;
}
fclose (in);
printf ("There are %d numbers in the file.\n", count);
printf ("The sum of all the numbers is %d.\n", sum);
average = (double)sum / count;
printf ("There average of all the numbers is %5.2lf.\n", average);
return (0);
}