recategorized by
8,136 views

9 Answers

2 votes
2 votes
a =SQR(b+2)=b+2*b+2=4+2*4+2=4+8+2=14
1 votes
1 votes
Consider the given program
#include<stdio.h>
int main()
{
int a;
int b=4;
a=SQR(b+2);//a=b+2*b+2
printf("%d\n",a);
return 0;
}

Here SQR(x) is replaced by macro to x*x

a=SQR (b+2)

  =b+2 * b+2

   = 4+2 * 4+2

   =4+8+2

So the program assign a=4+8+2=14 to variable a.14 will be printed .

edited by
0 votes
0 votes

a=SQR (b+2)  //now  Here SQR(x) is replaced by macro to x*x

whenever we define anything it will return exact form of it . 

  => b+2 * b+2

   => 4+2 * 4+2

   =>  4+8+2

   =>14    

 so output should be 14

    

edited by
0 votes
0 votes
sqr(b+2)

x=sqr(4+2)

x=(4+2*4+2)

x=14

ans will be 14 because in macro the evaluation is done after replacement

and macro done these variable replacement before compilation
Answer:

Related questions

2 votes
2 votes
4 answers
1
jenny101 asked Jun 25, 2016
4,938 views
The following three 'C' language statements is equivalent to which single statement?y=y+1; z=x+y; x=x+1z = x + y + 2;z = (x++) + (++y);z = (x++) + (y++);z = (x++) + (++y)...
6 votes
6 votes
3 answers
2
Sourabh Kumar asked Jun 22, 2016
5,665 views
How many lines of output does the following C code produce?#include<stdio.h float i=2.0; float j=1.0; float sum = 0.0; main() { while (i/j 0.001) { j+=j; sum=sum+(i/j); ...
8 votes
8 votes
7 answers
3