Here the evaluation of expression starts from right side of the statement. so all variables are of type integer..so the b/a which is float result, so it will be taken as zero. and finally we will get the answer as 10

execution starts from right hand side since * and / has higher priority 1) so b/a(of type int)=2/4=0 2)--y * (b/a) =0 3)x++ is post incrementer so answer is 5

Since b/a =0 so all term except x++ become 0 and coz of precedence rule first value of x is assing in z then incerement so value of z is 5

Ans a

DESTINY

Sep 21st, 2012

A. 5

mahesh sanadya

May 26th, 2013

10

M.Jamil

Oct 18th, 2016

int z,x=5,y=-10,a=4,b=2; z=(x++ - --y * b/a);(First we solve --y*b as precedence is ) (as --y = -11)
z=(x++ - (-11*b/a);
z=(x++ - (-22/4);
z=(x++ - (-5.2) Truncated So value will be only -5
write clear
z=(x++ -(-5);
x++ means 5 & when two minus are multiplied give result one +, so
z=5+5
z=10

## Int z;int x = 5;int y = -10;int a = 4;int b = 2;z = x++ - --y * b /a;What number will z in the sample code above containsA. 5B. 6C. 10D. 11

## Answer Question

Click here to Login / Register your free account

## Related Answered Questions

## Related Open Questions