250+ TOP MCQs on Standard Input & Output and Answers

C MCQs (multiple choice questions) on “Standard Input and Output”. One shall practice these MCQs to improve their C programming skills needed for various interviews (campus interviews, walkin interviews, company interviews), placements, entrance exams and other competitive exams. These questions can be attempted by anyone focusing on learning C Programming language. They can be a beginner, fresher, engineering graduate or an experienced IT professional. Our multiple choice questions come with detailed explanation of the answers which helps in better understanding of C concepts.

Here is a listing of C multiple choice questions on “Standard Input and Output” along with answers, explanations and/or solutions:

1. Which among the following is the odd one out?
a) printf
b) fprintf
c) putchar
d) scanf
Answer: d
Clarification: None.

2. For a typical program, the input is taken using _________
a) scanf
b) Files
c) Command-line
d) All of the mentioned
Answer: d
Clarification: None.

3. What does the following command line signify?

a) It runs prog1 first, prog2 second
b) It runs prog2 first, prog1 second
c) It runs both the programs, pipes output of prog1 to input of prog2
d) It runs both the programs, pipes output of prog2 to input of prog1
Answer: c
Clarification: None.

4. What is the default return-type of getchar()?
a) char
b) int
c) char *
d) reading character doesn’t require a return-type
Answer: b
Clarification: None.

5. What is the value of EOF?
a) -1
b) 0
c) 1
d) 10
Answer: a
Clarification: None.

6. What is the use of getchar()?
a) The next input character each time it is called
b) EOF when it encounters end of file
c) The next input character each time it is called EOF when it encounters end of file
d) None of the mentioned

Answer: c
Clarification: None.

7. Which of the following statement is true?
a) The symbolic constant EOF is defined in
b) The value is -1
c) The symbolic constant EOF is defined in & value is -1
d) Only value is -1
Answer: c
Clarification: None.

8. What is the return value of putchar()?
a) The character written
b) EOF if an error occurs
c) Nothing
d) Both character written & EOF if an error occurs
Answer: d
Clarification: None.

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top