The following problem list the operators line by line, where each line is a higher precedence than the operators underneath.
( postfix ) ++, ( postfix ) –
++ ( prefix ), — ( prefix )
*, >= , &
+ , – ,
– ( unary ) , + ( unary ) , %
> ,
&&, /, !
||, ˜| ( this symbol meant to be a tilde followed by a pipe )
=, /=
This problem will be using a left associative property on every operand that defaults to always doing the highest level operation from left to right. Show the order of evaluation of the following expressions by parenthesizing all sub-expressions and placing a superscript on the right parenthesis to indicate order. Like in the example from the chapter 7 problem set.
- a * b – 1 + c
- ) a * (b – 1) / c % d
- 3) (a – b) / c & (d * e / a – 3)
- 4) ( a + b <= c ) * ( d > b – e )
- 5) -a || c = d && e
- 6) a > b ˜| c || d
- 7) -a + b
- 8) a + b * c + d