Bird
0
0

What will this code print?

easy📝 Conceptual Q2 of 15
C - Input and Output
What will this code print?
printf("Hello %s!", "World");
AHello %s!
BHello %s! World
CHello World
DHello World!
Step-by-Step Solution
Solution:
  1. Step 1: Understand string format specifier %s

    The %s in printf is replaced by the string argument provided, here "World".
  2. Step 2: Combine the string and format

    The output becomes "Hello World!" exactly as the format string with %s replaced.
  3. Final Answer:

    Hello World! -> Option D
  4. Quick Check:

    String substitution with %s = Hello World! [OK]
Quick Trick: Use %s to insert strings inside printf output [OK]
Common Mistakes:
  • Printing %s literally
  • Missing the argument for %s
  • Forgetting quotes around string

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More C Quizzes