Explore topic-wise MCQs in C Programming.

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

1.

Which of the following statements about stdout and stderr are true?

A. Same
B. Both connected to screen always
C. Both connected to screen by default
D. stdout is line buffered but stderr is unbuffered
Answer» D. stdout is line buffered but stderr is unbuffered
2.

stdout, stdin and stderr are ________

A. File pointers
B. File descriptors
C. Streams
D. Structure
Answer» B. File descriptors
3.

What is FILE reserved word?

A. A structure tag declared in stdio.h
B. One of the basic data types in c
C. Pointer to the structure defined in stdio.h
D. It is a type name defined in stdio.h
Answer» E.
4.

What does the following segment of C code do?

A. It writes “Copying!” into the file pointed by fp
B. It reads “Copying!” from the file and prints on display
C. It writes as well as reads “Copying!” to and from the file and prints it
D. None of the mentionedView Answer
Answer» B. It reads “Copying!” from the file and prints on display
5.

Which type of files can’t be opened using fopen()?#

A. .txt
B. .bin
C. .c
D. none of the mentioned
Answer» E.
6.

Which of the following mode argument is used to truncate?

A. a
B. f
C. w
D. t
Answer» D. t
7.

Attach

A. Append
B. Apprehend
C. Add
Answer» C. Add
8.

In C language, FILE is of which data type?

A. int
B. char *
C. struct
D. None of the mentioned
Answer» E.
9.

When a C program is started, O.S environment is responsible for opening file and providing pointer for that file?

A. Standard input
B. Standard output
C. Standard error
D. All of the mentioned
Answer» C. Standard error
10.

What is the return value of getc()?

A. The next character from the stream is not referred by file pointer
B. EOF for end of file or error
C. Nothing
D. None of the mentioned
Answer» D. None of the mentioned
11.

What will fopen will return, if there is any error while opening a file?

A. Nothing
B. EOF
C. NULL
D. Depends on compiler
Answer» C. NULL
12.

For binary files, a ___ must be appended to the mode string.

A. Nothing
B. “b”
C. “binary”
D. “01”
Answer» B. ‚Äö√Ñ√∂‚àö√ë‚àö‚à´b‚Äö√Ñ√∂‚àö√ë‚àöœÄ