0
How are arithmetic expressions computed?
I have an Exam soon and there will be questions on expressions, some examples are: 1. 3 + 5 + 5/3*9 2. 6*6/6*6/6 For examples like these, I don’t know if division or multiplication is supposed to come first. For #1 , the multiplication of 9 and 3 come first but for #2, it’s 6*(6/6)*(6/6) so division would come before multiplying. How would I be sure of what comes first?
3 ответов
+ 14
Simple school math trick of BODMAS can be used to evaluate the expressions.
B Brackets first
O Orders
(ie Powers and Square Roots, etc.)
DM Division and Multiplication
(left-to-right)
AS Addition and Subtraction
(left-to-right)
Therefore, 1 + 2 + 3 * 4; is 15
and 2 * 3 + 4 is 10.
+ 7
Multiplication and division have the same precedence.
Also don't add brackets by yourself, that way you change the precedence and the output
Here's how it works :
1. 3+5+5/3*9= 8+1*9= 8+9= 17
2. 6*6/6*6/6= 36/6*6/6= 6*6/6= 36/6= 6
- 1
Hello I am Yorqin