Wednesday, 10 December 2014

Programming Quiz-12

Q: What is the output of this C code?

#include <stdio.h>

int main()

{

    char *p[1] = {"hello"};

    printf("%s", (p)[0]);

    return 0;

}

 Options:

a) Compile time error
b) Undefined behaviour
c) hello
d) None of the mentioned

Answer: C

No comments:

Post a Comment