// // reading_from_a_file.c // // // Created by Bibhas Ghoshal on 11/08/20. // #include #include int main() { int num; FILE *fptr; if ((fptr = fopen("./my_program.txt","r")) == NULL){ printf("\nError! opening file\n"); // Program exits if the file pointer returns NULL. exit(1); } fscanf(fptr,"%d", &num); printf("\nValue of n=%d\n", num); fclose(fptr); return 0; }