Examveda
Examveda

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.


This Question Belongs to C Program >> C Miscellaneous

Join The Discussion

Comments ( 3 )

  1. Mainak Karmakar
    Mainak Karmakar :
    2 years ago

    according to the size of byte that takes "sizeof" to store given data is 1. so the answer should be one

  2. Tararam Goyal
    Tararam Goyal :
    6 years ago

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

  3. Camadi Chanal
    Camadi Chanal :
    6 years ago

    Please explain the answer sir

Related Questions on C Miscellaneous