Computer Science, asked by Nousher, 11 months ago

void
main()
{
int a=10; b= 6;
printf("%d\n%d", a, b) ;
a= a+b-(b=a);
printf ("%d\n%d", a,b);
}​

Answers

Answered by Adarshthakur11
0

Answer:

10

6

16

6

Explanation:

First output ->

a is equal to 10 and b is equal to 6

therefore the values will be displayed.

since there is \n which means that after displaying the first number the pointer will move to the starting of the next line .so the next number will be displayed in next line.

Second Output->

a=a+b-(a=b)

since () have higher precedence,it will be evaluated first.

so here a is not equal to b which means it is false that is its value is 0

then the rest of the expression will.be evaluated.

so

a=10+6-(0)

a=16.

and b= 6

hope it helps you

Similar questions