Determine Output:
#define int char
void main()
      int i = 65;
      printf("sizeof(i)=%d", sizeof(i));

A. sizeof(i)=2

B. sizeof(i)=1

C. Compiler Error

D. None of These

Answer: Option B

Solution(By Examveda Team)

Since the #define replaces the string int by the macro char.

Join The Discussion

Comments ( 2 )

  1. Tararam Goyal
    Tararam Goyal :
    2 years ago

    output of the above code is depends upon compiler ( vary compiler to compiler) according to option correct option is "sizeof(i)=2"

  2. Camadi Chanal
    Camadi Chanal :
    2 years ago

    Please explain the answer sir

Related Questions on C Miscellaneous