int z,x=5,y=-10,a=4,b=2;
z = x++ - --y * b / a;
Value of z:

Options
- 10
- 11
- 12
- 5
- 6


CORRECT ANSWER : 10

Discussion Board
RULE

why aren''t we following BODMAS rule


PRAVIN 08-31-2018 01:30 AM

increment and decrement

This platform is very useful for me. But i can''t clearly understand the discussion board explanation becoz --10 value is 9 why you should increement the value as 11.pls give a clear explanation.

udhaya 09-12-2017 06:01 AM

Correct Explanation

z= x++ - --y * b / a;
z= 5++ - (-- -10) *2/4
z= 5++ - (-11*2) /4 // decrement of -10 is -11
z= 5++ - (-22/4)
z= 5++ - (-5)
z= 5++ + 5
z= 5++ + 5
z= 10 //5++ will be incremented after operation on 5 is done
//value of x will be 6 after it assigns value of z to be 10.

Arif 11-15-2016 02:26 PM

this answer 10

this progaram is using the operaters . so operater in *,/,+,_ on alpbet order.

PRAKASH.k 11-3-2014 12:01 AM

i think

5++ - --(-10)*2/4
5++ - --(-10)*0.5 // explicitly type casting to float
5++ - (-11)*0.5
5++ - (-5.5)
5 + 5.5
10.5
10 // explicitly type casting to int

hmmm 10-20-2014 06:35 AM

How???

Why you haven't increment 5++ ???????

Suganya 10-12-2014 12:11 AM

++ and -- having more precedence than * and / so.........

explantion give progam


z=5++ - -- -10*2/4
z=5++ - -11*2/4
z=5++ - -22/4
z=5++ - -5
z=5++ + 5
z=10

shankar 08-15-2014 03:29 AM

ee

its a nice platform to build one's basics. you should display the result of every ques.


chandraditya jha 07-19-2014 09:34 AM

explantion give progam

z=5++ - -- -10*2/4
z=5++ - -- -20/4
z=5++ - -- -5
z=5++ + 5
z=10

sarath 07-2-2014 01:34 AM

math

bal

bob biswas 09-16-2013 05:08 PM

Write your comments


Enter the code shown above:

(Note: If you cannot read the numbers in the above image, reload the page to generate a new one.)


Advertisement