CPSC 170 PreLab 10
Postfix Expressions and Modular Arithmetic
- Convert each infix expression below to postfix:
- a + (b * (c - (d / e)))
- (((a + b) * c) - d) / e
- Convert each postfix expression below to infix.
- a b c d e f + * - / %
-
a b c d + * e f - / %
- Use a stack to evaluate the postfix expression below. Show your
work.
50 20 5 - 2 1 + * -
- Evaluate each expression below.
- (3 + 5) % 6
- (4 * 2 + 3) % 5
- ((n-1) + 2) % n, n > 2