You are not logged in.
- Topics: Active | Unanswered
Pages:: 1
#1 2015-04-18 05:13:54
Output Of The Program?
Directions:
#include<stdio.h>
#define prod(a,b) a*b
void main()
{
int x=3,y=4;
printf("%d", prod(x+2,y-1));
}
Question:
What will be the output of the following program?
Option A):
12
Option B):
10
Option C):
11
Option D):
15
Correct Answer is Option B):
10
Explanation:
The macro expands and evaluates to as:
x+2*y-1 => x+(2*y)-1 => 10
Failure is the first step towards seccess.
Offline
2015-04-18 05:13:54
- Advertisement
- Ads By Google
Re: Output Of The Program?
\n
Pages:: 1