Vidyalelo
C Programming · Q194

Pointer

Programming · C Programming · question 194

Q194

What will be the output of the following C code? #include int main() char *p = NULL; char *q = 0; if (p) printf(" p "); else printf("nullp"); if (q) printf("q "); else printf(" nullq ");

A.
nullp nullq
Answer
B.
Depends on the compiler
C.
x nullq where x can be p or nullp depending on the value of NULL
D.
p q

Answer: Option A

Solution

Answer: Option A
No explanation is given for this question Let's Discuss on Board