How are many number of characters available in newname.txt?
Posted: Wed Jul 13, 2022 7:53 pm
#include <stdio.h> int main () { FILE * p; int n = 0; p = fopen ("newname.txt", "rb"); if (p == NULL) perror ("Error opening file"); else { while (fgetc(p) != EOF) { ++n; } if (feof(p)) { printf ("%d\n", n); } else puts ("End-of-File was not reached."); fclose (p); } return 0; }
a) 10
b) 15
c) Depends on the text file
d) 34
a) 10
b) 15
c) Depends on the text file
d) 34