This set of C Multiple Choice Questions & Answers (MCQs) focuses on “Standard Input & Output – 1”.
Pre-requisite for this C MCQ set: Advanced C Programming Video Tutorial.
1. Which among the following is the odd one out?
a) printf
b) fprintf
c) putchar
d) scanf
View Answer
Explanation: None.
2. For a typical program, the input is taken using _________
a) scanf
b) Files
c) Command-line
d) All of the mentioned
View Answer
Explanation: None.
3. What does the following command line signify?
prog1|prog2
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
View Answer
Explanation: 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
View Answer
Explanation: None.
5. What is the value of EOF?
a) -1
b) 0
c) 1
d) 10
View Answer
Explanation: 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
View Answer
Explanation: None.
7. Which of the following statement is true?
a) The symbolic constant EOF is defined in <stdio.h>
b) The value is -1
c) The symbolic constant EOF is defined in <stdio.h> & value is -1
d) Only value is -1
View Answer
Explanation: 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
View Answer
Explanation: None.
Sanfoundry Global Education & Learning Series – C Programming Language.
To practice all areas of C language, here is complete set of 1000+ Multiple Choice Questions and Answers.
- Watch Advanced C Programming Videos
- Apply for C Internship
- Check Computer Science Books
- Practice Computer Science MCQs
- Apply for Computer Science Internship