#include #include int main(){ FILE * f = fopen("Test.txt","r");//rediction int i, j, k; if(!f) { printf("File does not exist.\n"); exit(1); } //scanf return the number of successfuly read inputs or else EOF while(1){ if (fscanf(f,"%d", &i)==EOF) break; printf("%d\n", i); } /* //to read for example 3 ints a time: while(1){ if (fscanf(f,"%d %d %d", &i, &j,&k)!=3)//must check the number of read inputs break; printf("%d\n", i+j+k); } */ if (fclose(f) == 0){ printf("Close success.\n"); } return 0; }