40-8/2*(3+1)
Let's evaluate: 40 -82×(3 + 1)
ⓘ Parentheses are computed first: 3 + 1 = 4
40 -82×4
ⓘ We simplify the fraction by dividing the numerator and the denominator by 2, their greatest common divisor: 82 = 4
40 -4×4
ⓘ Multiplications are done before additions and subtractions: 4×4 = 16
40 -16
ⓘ Start from 40 and move back 16 on the number line: 40 -16 = 24
▶Result:   24