You are not logged in.

#1 2015-04-18 05:13:54

hasnain
Administrator
From: Chichawatni
Registered: 2014-10-13
Posts: 8,355
Website

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.

2015-04-18 05:13:54

Advertisement
Ads By Google

Re: Output Of The Program?



\n

Board footer