Java OCA OCP Practice Question 1740

Question

What is the value of evaluating the following expression (- -1-3 * 10 / 5-1)?.

Select the one correct answer.

  • (a) -8
  • (b) -6
  • (c) 7
  • (d) 8
  • (e) 10
  • (f) None of the above.


(b)

Note

The expression evaluates to -6.

The whole expression is evaluated as (((-(-1)) - ((3 * 10) / 5)) - 1) according to the precedence and associativity rules.




PreviousNext

Related