What will the output of the given program be? main()
What will the output of the given program be?
#include<stdio.h>
main()
{
printf(6+"Hello World\n");
}
Show answerHide answer
Correct answer: (B) Compilation error
Explanation
Note: the answer key gives (B), but the code compiles. 6 + "Hello World\n" is pointer arithmetic that skips the first 6 characters, so printf prints 'World' (C).