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.

Subscribe Newsletter & Posts
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.


1000 C MCQs | Quiz

Variable Names - 1
Data Types and Sizes - 1
Constants - 1
Declarations - 1
Arithmetic Operators - 1
Relational & Logical Operators - 1
Type Conversions - 1
Increment and Decrement Operators - 1
Bitwise Operators - 1
Assigment Operators & Expressions - 1
Conditional Expressions - 1
Precedence and Order of Evaluation - 1
Precedence and Order of Evaluation - 2
Precedence and Order of Evaluation - 3
Variable Names - 2
Data Types and Sizes - 2
Constants - 2
Declarations - 2
Arithmetic Operators - 2
Relational & Logical Operators - 2
Type Conversions - 2
Increment and Decrement Operators - 2
Bitwise Operators - 2
Assigment Operators & Expressions - 2
Conditional Expressions - 2
Precedence and Order of Evaluation - 4
Precedence and Order of Evaluation - 5
Precedence and Order of Evaluation - 6
If-then-else Statements - 1
Switch Statements - 1
For Loops - 1
While Loops - 1
Break and Continue - 1
Goto & Labels - 1
If-then-else Statements - 2
Switch Statements - 2
For Loops - 2
While Loops - 2
Break and Continue - 2
Goto & Labels - 2
Basics of Functions - 1
Functions Returning Non-integers - 1
External Variables - 1
Scope of a Variable - 1
Static Variables - 1
Register Variables - 1
Automatic Variables - 1
C-Preprocessor - 1
File Inclusion - 1
Macro Substitution - 1
Conditional Inclusion - 1
Basics of Functions - 2
Functions Returning Non-integers - 2
External Variables - 2
Scope of a Variable - 2
Static Variables - 2
Register Variables - 2
Automatic Variables - 2
C-Preprocessor - 2
File Inclusion - 2
Macro Substitution - 2
Conditional Inclusion - 2
Pointers and Addresses - 1
Pointers and Function Arguments - 1
Pointers and Arrays - 1
Address Arithmetic - 1
Character Pointers and Functions - 1
Pointers to Pointers - 1
Multidimensional Arrays - 1
Initialization of Pointer Arrays - 1
Pointers Vs. Multi-dimensional Arrays - 1
Command Line Arguments - 1
Pointers to Functions - 1
Complicated Declarations - 1
Pointers and Addresses - 2
Pointers and Function Arguments - 2
Pointers and Arrays - 2
Address Arithmetic - 2
Character Pointers and Functions - 2
Pointers to Pointers - 2
Multidimensional Arrays - 2
Initialization of Pointer Arrays - 2
Pointers Vs. Multi-dimensional Arrays - 2
Command Line Arguments - 2
Pointers to Functions - 2
Complicated Declarations - 2
Basics of Structures - 1
Structures and Functions - 1
Arrays of Structures - 1
Pointer to Structures - 1
Self-Referential Structures - 1
Table Lookup - 1
Typedefs - 1
Unions - 1
Bit-fields - 1
Basics of Structures - 2
Structures and Functions - 2
Arrays of Structures - 2
Pointer to Structures - 2
Self-Referential Structures - 2
Table Lookup - 2
Typedefs - 2
Unions - 2
Bit-fields - 2
Standard Input & Output - 1
Formatted Output - 1
Variable Length Argument - 1
Formatted Input - 1
File Access - 1
Error Handling - 1
Line Input & Output - 1
String Operations - 1
Character Class Testing & Conversions - 1
Ungetc - 1
Storage Management - 1
Mathematical Functions - 1
Random Number Generation - 1
Standard Input & Output - 2
Formatted Output - 2
Variable Length Argument - 2
Formatted Input - 2
File Access - 2
Error Handling - 2
Line Input & Output - 2
String Operations - 2
Character Class Testing & Conversions - 2
Ungetc - 2
Storage Management - 2
Mathematical Functions - 2
Random Number Generation - 2
Float Datatype - 1
Sizeof - 1
Float Datatype - 2
Sizeof - 2
Follow Manish & Sanfoundry