#include #include // This simple program reads and prints all ints stored in the file ints.txt // The program stops reading once the end of file (EOF) is reached. int main() { FILE* fp; if( (fp = fopen("ints.txt", "r")) == NULL) { printf("File not found!\n"); } else { int res, num; while( (res = fscanf(fp, "%d", &num)) != EOF) { printf("%2d\n", num); } fclose(fp); } system("pause"); }