+ 1

Wrong calculation from eval function

Why this calculation equal 55. it's should be equal 100 https://code.sololearn.com/WRh3fh8viTWq/?ref=app

15th Dec 2021, 3:25 AM
EsaKurniawan
5 Antworten
+ 2
Because of BODMAS rule. Multiplication has more priority than addition. So 5+(5*10) 5+50 55
15th Dec 2021, 3:32 AM
Azhagesanヾ(✿)
Azhagesanヾ(✿) - avatar
+ 1
Oh okay I'll try it
15th Dec 2021, 3:42 AM
EsaKurniawan
0
How to get 100 in results
15th Dec 2021, 3:35 AM
EsaKurniawan
0
I can not use 10 * 10 because i'm in calculator project so the input is depends on user
15th Dec 2021, 3:38 AM
EsaKurniawan
0
Use parenthesis to increase priority. Like (5+5)*10
15th Dec 2021, 3:38 AM
Azhagesanヾ(✿)
Azhagesanヾ(✿) - avatar