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

Showing Answers 1 - 6 of 6 Answers

Vijaya Bhaskar M

  • Jul 24th, 2005
 

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

umesh_singh

  • Mar 26th, 2007
 

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

DESTINY

  • Sep 21st, 2012
 

A. 5

  Was this answer useful?  Yes

mahesh sanadya

  • May 26th, 2013
 

10

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

Answer Question

Click here to Login / Register your free account


 
Send   Reset

 

Related Answered Questions

 

Related Open Questions