ExamVeda
Login
Home
This question belongs to C Program C Miscellaneous
C Miscellaneous
?

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

Answer & Solution
Correct Answer: Option B

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

Examveda
Question posted by Examveda
Community

Join the Discussion

1 Comment
Navya Gayathri
Navya Gayathri 6 years ago
Can anyone explain how 300 is printed