Lecture 4:  Arithmetic Expressions

Activity:

Simplify the following expressions (remember, these expressions are written in the C language and may not follow conventional mathematical rules):

1.  (15 / 2) * (3 / 2)
2.  15 * 3 / 2 / 2
3.  3 / 2 * 15 / 2
4.  15 / 2 * 3 / 2
5.  (15 * 3)/(2 * 2)
6.  (15.0 * 3) / 2
7.  (int) (15.0 / 2.0)
8.  8 + 7 % 6 - 5
9.  6 - -3 * 50 % (48 + 9 / 8)
10. (double) 10 / 4
11. (double) (10 / 4)
12. (int) ((double) 10) / (double) 4 + 1.0