Examveda
Examveda

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

A. %d\n

B. 300

C. Error

D. None of These

Answer: Option B

Solution(By Examveda Team)

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


This Question Belongs to C Program >> C Miscellaneous

Join The Discussion

Comments ( 1 )

  1. Navya Gayathri
    Navya Gayathri :
    4 years ago

    Can anyone explain how 300 is printed

Related Questions on C Miscellaneous