Vidyalelo
C Programming · Q41

C Miscellaneous

Programming · C Programming · question 41

Q41

Determine Output: void main() char *p; p="%d "; p++; p++; printf(p-2, 300);

A.
%d\n
B.
300
Answer
C.
Error
D.
None of These

Answer: Option B

Solution

Answer: Option B
Solution:

The pointer points to % since it is incremented twice and again decremented by 2, it points to '%d\n' and 300 is printed.