Determine Output:
#define int char
void main()
{
int i = 65;
printf("sizeof(i)=%d", sizeof(i));
}
#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.
according to the size of byte that takes "sizeof" to store given data is 1. so the answer should be one
output of the above code is depends upon compiler ( vary compiler to compiler) according to option correct option is "sizeof(i)=2"
Please explain the answer sir