Bird
0
0

What will be the output of the following C program?

medium📝 Predict Output Q13 of 15
C - Basics and Execution Environment
What will be the output of the following C program?
#include 
int main() {
    printf("Welcome to C programming!\n");
    return 0;
}
ANo output
BWelcome to C programming!\n
CSyntax Error
DWelcome to C programming!
Step-by-Step Solution
Solution:
  1. Step 1: Understand the printf statement

    The string inside printf includes \n which means new line after printing.
  2. Step 2: Predict the output

    The program prints "Welcome to C programming!" followed by a new line.
  3. Final Answer:

    Welcome to C programming! -> Option D
  4. Quick Check:

    \n creates new line, output is plain text [OK]
Quick Trick: \n means new line, not literal text [OK]
Common Mistakes:
  • Thinking \n prints as text
  • Expecting syntax error due to \n
  • Ignoring the return statement effect

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More C Quizzes