Bird
0
0

What will be the output of this C program?

medium📝 Predict Output Q13 of 15
C - Basics and Execution Environment
What will be the output of this C program?
#include <stdio.h>
int main() {
    printf("Hello, C!\n");
    return 0;
}
AHello, C!
BHello, C!\n
Cprintf("Hello, C!\n");
DError: missing semicolon
Step-by-Step Solution
Solution:
  1. Step 1: Understand printf output

    The printf function prints the string inside quotes to the screen.
  2. Step 2: Interpret escape sequence

    The \n adds a new line but does not print literally.
  3. Final Answer:

    Hello, C! -> Option A
  4. Quick Check:

    printf prints string with newline [OK]
Quick Trick: Remember \n means new line, not printed text [OK]
Common Mistakes:
  • Thinking \n prints as text
  • Confusing code with output
  • Assuming syntax error without cause

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More C Quizzes