Solution Review: Arithmetic Operators
In this review: we give a detailed analysis of the solution to this exercise.
Solution #1: Operator Precedence
Press + to interact
R
ans <- 4 * 9ans <- ans + 2ans <- ans - 8cat(ans)
Explanation
The given task here was to find the value of the equation
2 + 4 * 9 - 8
Mathematically, we need to find the value of the multiplying numbers first, keeping in mind operator precedence. So, we multiply ...