You are not logged in.
- Topics: Active | Unanswered
Pages:: 1
#1 2015-04-18 05:03:54
Output Of The Program?
Directions:
#include<stdio.h>
#define square(x) x*x
void main()
{
int i;
i = 64/square(4);
printf("%d", i);
}
Question:
What will be the output of the following program?
Option A):
None
Option B):
4
Option C):
64
Option D):
16
Correct Answer is Option C):
64
Explanation:
The macro call square(4) will be substituted by 4*4 so the expression becomes i = 64/4*4 . Since / and * has equal priority and associativity left to right, so the expression will be evaluated as (64/4)*4 i.e. 16*4 = 64.
Failure is the first step towards seccess.
Offline
2015-04-18 05:03:54
- Advertisement
- Ads By Google
Re: Output Of The Program?
\n
Pages:: 1