Question discussion

What will the output of the given program be?#include main() { printf(6+”Hello World\n”); }

3108Hard DSSSB TGT Computer Science 0 replies 2 views
0

What will the output of the given program be?

#include<stdio.h>
main()
{
    printf(6+”Hello World\n”);
}
  • A6Hello World
  • BCompilation error
  • CWorld
  • DHello
Correct answer: B

Explanation

The string in the given code uses typographic quotes (” ”) instead of plain double quotes, which is not valid C syntax, so the official answer key marks Compilation error.

Discussion 0

Nobody has replied yet. Start the discussion!