Exercises in Arithmetic

  1. Convert these infix expressions to the corresponding ClojureScript expressions. The number after the arrow is the value you should get as a result. You can use the active code box to test your expressions.

    1. 5 * 2 → 10
    2. 3 + 4 * 7 - 5 → 26
    3. (3 + 6) * (9 - 5) → 36
    4. 12 / 15 * 4 → 3.2
    5. 4 * (12 * 3) / (13 + 35) → 3
    6. ((9 - 12) / 5) * 7 → -4.2
    7. ((8 - 10) * 11) - ((14 - 2) + 7) → -41
    1. (* 5 2) → 10
    2. (+ 3 (- (* 4 7) 5)) → 26
    3. (* (+ 3 6) (- 9 5) → 36
    4. (* (/ 12 15) 4) → 3.2
    5. (* 4 (/ (* 3 12) (+ 13 35))) → 3
    6. (* (/ (- 9 12) 5) 7) → -4.2
    7. (- (* (- 8 10) 11) (+ (- 14 2) 7)) → -41
Next Section - Symbols