C Programming Questions and Answers – Standard Input & Output – 1

This section on C MCQs (multiple choice questions) focuses 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 odd one out?
a) printf
b) fprintf
c) putchar
d) scanf
View Answer

Answer:d

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

Answer:d

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

Answer:c

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

Answer:b

5. The value of EOF is_____.
a) -1
b) 0
c) 1
d) 10
View Answer

Answer:a

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) Both a & b
d) None of the mentioned
View Answer

Answer:c

7. Which is true?
a) The symbolic constant EOF is defined in
b) The value is typically -1,
c) Both a & b
d) Either a or b
View Answer

Answer:c

8. What is the use of putchar()?
a) The character written
b) EOF is an error occurs
c) Nothing
d) Both a & b
View Answer

Answer:d

Sanfoundry Global Education & Learning Series – C Programming Language.

Here’s the list of Best Reference Books in C Programming Language.

To practice all features of C programming language, here is complete set of 1000+ Multiple Choice Questions and Answers on C.

About

Manish Bhojasia, a technology veteran with 17+ years @ Cisco & Wipro, is Founder and CTO at Sanfoundry. He is Linux Kernel Developer and SAN Architect and is passionate about competency developments in these areas. He lives in Bangalore and delivers focused training sessions to IT professionals in Linux Kernel, Linux Debugging, Linux Device Drivers, Linux Networking, Linux Storage & Cluster Administration, Advanced C Programming, SAN Storage Technologies, SCSI Internals and Storage Protocols such as iSCSI & Fiber Channel. Stay connected with him below.


Sanfoundry Training Center of Excellence (CoE)

Manish Bhojasia, a technology veteran with 17+ years @ Cisco & Wipro, is Founder and CTO at Sanfoundry. He is Linux Kernel Developer and SAN Architect and is passionate about competency developments in these areas. He lives in Bangalore and delivers focused training sessions to IT professionals in Linux Kernel, Linux Debugging, Linux Device Drivers, Linux Networking, Linux Storage & Cluster Administration, Advanced C Programming, SAN Storage Technologies, SCSI Internals and Storage Protocols such as iSCSI & Fiber Channel. Stay connected with him below.







Sanfoundry Internships
Subscribe Newsletter & Posts
Follow Manish & Sanfoundry