m=4.5, n=2.5, p; m=2*m++ +3*n-- +2*3/5 n=--m + --n+(m+n)*1.5 p=(m-n>5)?m*2.5:n*2.5;​

Answers 1

Answer: m=16.5

n=42.5

p=106.25

Explanation: As increment and decrement operators are having higher precedence than multiplication and addition, multiplication and division are having  higher precedence than addition.

So first we will solve the m part where we will use the value of m as 4.5 and then increment and same goes for n we will first use n's value as 2.5 then we will decrement it to 1.5, then we will go on following the precedence in the statement.

Then comes n where we will use the new value of m as 16.5 and first we will decrease the value of n by 1 as decrement operator is beforehand and then we will be calculating the answer, the same way as we did for m.

Then comes p here we have got the value of m and n and as the first conditions states that (m-n>5), which is wrong as (16.5-42.5>5) so as this condition is wrong the value of n*2.5 will be assigned to p.

If you know the answer add it here!

Can't find the answer?

Log in with Google

or

Forgot your password?

I don't have an account, and I want to Register

Choose a language and a region
How much to ban the user?
1 hour 1 day 100 years