4 * Purpose: to sum the integers in the file sumit.dat
5 * Author: pc2@ecs.csus.edu or http://www.ecs.csus.edu/pc2
7 * Tue Oct 19 21:32:14 PDT 1999
9 * caveat - this is not nice code, copy at own risk ;)
11 * $Id: sumit.c,v 1.1 2005/03/06 05:13:57 laned Exp $
17 #define INFILENAME "sumit.dat"
21 FILE *fp
= fopen (INFILENAME
,"r");
27 while (1==fscanf(fp
, "%d", &i
))
32 printf("The sum of the positive integers is %d \n",sum
);
36 printf("Could not read from file sumit.dat \n");