precedence rules.
Precedence Hierarchy
Precedence Operator
highest *, /, %
+, -, &, |
==, !=, - (unary)
=, /=, <, <=, >=, >
and
lowest or, xor
As an example, for the expression
a + b % c - d
the order of evaluation would be
( ( a + ( b % c )^1 )^2 - d )^3
where the superscript numbers (via added parenthesis) denote the order of evaluation.
For the following expression given, show the order of evaluation.
x * y - z + 42
Group of answer choices
( ( ( x * y )^3 - z )^2 + 42 )^1
( ( ( x * y )^2 - (z + 42)^1 )^3
( ( x * y )^1 - z + 42 )^2
( ( ( x * y )^1 - z )^2 + 42 )^3
( ( ( x * y )^2 - z )^1 + 42 )^3