Explore topic-wise MCQs in Technical MCQs.

This section includes 6 Mcqs, each offering curated multiple-choice questions to sharpen your Technical MCQs knowledge and support exam preparation. Choose a topic below to get started.

1.

In fopen(), the open mode "wx" is sometimes preferred "w" because. 1) Use of wx is more efficient. 2) 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 1
B. Only 2
C. Both 1 and 2
D. Neither 1 nor 2
E.
Answer» C. Both 1 and 2
2.

which Is data type of file pointer is?

A. int
B. double
C. void
D. File
Answer» E.
3.

#include <stdio.h>int main(){    int i=3;    printf("i=%*d", i, i);    return 0;}
28.stderr, stdin, stdout are FILE pointers

A. Yes
B. No
C. May Be
D. Can't Say
Answer» B. No
4.

Select text file in which data is stored in

A. ASC11 code
B. Binary code
C. Octal code
D. text code
Answer» B. Binary code
5.

Select a function which is used to write a string to a file?

A. pits()
B. putc()
C. fputs()
D. fgets()
Answer» D. fgets()
6.

#include <stdio.h>int main(){    char c;    FILE *fp;    fp=fopen("demo.txt","a+"); // demo.txt : hello you are reading a file    fprintf(fp," demo");    	fclose(fp);    fp=fopen("myfile.txt","r");        while((c=fgetc(fp))!=EOF)         printf("%c",c);    fclose(fp);    return 0;}
22.A data of the file is stored in?

A. Ram
B. Hard disk
C. Rom
D. None
Answer» C. Rom