Expressions
Category: Expressions
Author: Benson Limketkai
Book Chapter: 2.1
Problem: Expressions
For each expression in the left-hand column, indicate its value in the right-hand column. Be sure to list a constant of appropriate type (e.g., 7.0 rather than 7 for a double, Strings in "quotes"). If the expression is illegal, then write "error".
1) 1 * 2 * 3 + (4 - 5)
2) 28 % 4 + 18 % 5 % 5 + 9
3) 1000 * 2 + 18 / 2 / 2 * 2
4) 1 / 10.0 + "1" + 17 * 2
5) 0.25 * 2 - 0.5 + 1 / 2