Bird
0
0

Which header file must be included to use the printf function in a C program?

easy📝 Conceptual Q2 of 15
C - Basics and Execution Environment
Which header file must be included to use the printf function in a C program?
A<stdlib.h>
B<stdio.h>
C<string.h>
D<math.h>
Step-by-Step Solution
Solution:
  1. Step 1: Identify the purpose of header files

    Header files provide declarations for functions. To use printf, the program needs its declaration.
  2. Step 2: Match printf function to its header file

    The printf function is declared in the header file, which stands for standard input/output.
  3. Final Answer:

    <stdio.h> -> Option B
  4. Quick Check:

    Header for printf = <stdio.h> [OK]
Quick Trick: Use for input/output functions like printf [OK]
Common Mistakes:
  • Using instead of
  • Forgetting to include any header file

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More C Quizzes