You are not logged in.
- Topics: Active | Unanswered
Pages:: 1
#1 2015-04-18 05:01:06
Output Of The Program?
Directions:
#include<stdio.h>
#define int char
void main()
{
int i = 65;
printf("sizeof(i)=%d", sizeof(i));
}
Question:
What will be the output of the program?
Option A):
None
Option B):
Compiler Error
Option C):
sizeof(i)=2
Option D):
sizeof(i)=1
Correct Answer is Option D):
sizeof(i)=1
Explanation:
Since the #define replaces the string int by the macro char.
So, here i is a variable of type char and not int.
Failure is the first step towards seccess.
Offline
2015-04-18 05:01:06
- Advertisement
- Ads By Google
Re: Output Of The Program?
\n
Pages:: 1