1.

        Note:Includes all required header files using namespace std;    int main ()   {    FILE *fp;    char x[1024];    fp = fopen("find.txt", "r");  // "ayushjain and prateek"     x[0] = getc(fp);                  fseek(fp, 0, SEEK_END);            fseek(fp, -7L, SEEK_CUR);          fgets(x, 6, fp);                 puts(x);                         return 0;} 
18.In fopen(), the open mode "wx" is sometimes preferred "w" because. i) Use of wx is more efficient. ii) If w is used, old contents of file are erased and a new empty file is created. When wx is used, fopen() returns NULL if file already exists.

A. Only i
B. Only ii
C. Both i & ii
D. None of the above
Answer» C. Both i & ii


Discussion

No Comment Found

Related MCQs