Difficulty: Easy
Correct Answer: stdio.h
Explanation:
Introduction / Context:
C provides standard I/O via a dedicated header that declares FILE
, stream functions, macros, and related constants. This question targets recognition of the correct header file.
Given Data / Assumptions:
Concept / Approach:
The header <stdio.h>
declares standard input/output facilities: FILE
, stdin
, stdout
, stderr
, and functions like printf
, scanf
, fopen
, fgets
, and fwrite
. Other headers serve different domains (stdlib.h
for general utilities, string.h
for strings, etc.).
Step-by-Step Solution:
Verification / Alternative check:
Any C reference will list <stdio.h>
as the source of I/O declarations and macros like EOF
and BUFSIZ
.
Why Other Options Are Wrong:
conio.h: Non-standard, DOS/Windows compiler specific.
stdlib.h: General utilities (memory allocation, conversions, exit
), not I/O streams.
dos.h: Non-standard DOS utilities.
Common Pitfalls:
stdlib.h
contains I/O because it is widely used.
Final Answer:
stdio.h
Discussion & Comments