Which one is preferred first - multiplication or division ? Do this follow BODMAS rule or PEMDAS rule? | Sololearn: Learn to code for FREE!
Novo curso! Todo programador deveria aprender IA generativa!
Experimente uma aula grƔtis
0

Which one is preferred first - multiplication or division ? Do this follow BODMAS rule or PEMDAS rule?

22nd Oct 2020, 6:56 AM
Sri Laya
Sri Laya - avatar
3 Respostas
+ 15
In most the language multiplication & division has same precedence! āœØ The one which will come first(from left) will be preferred āœØ Eg: 2 * 3 / 2 ( multiplication came first) 6 / 2 3 2 / 2 * 4 ( division came first) 1 * 4 4 Hope this helps šŸ’•šŸ’•
22nd Oct 2020, 7:29 AM
Aakaanksha šŸ’• [TheBraveCoders]
Aakaanksha šŸ’• [TheBraveCoders] - avatar
+ 3
PEMDAS will only give you the operator precedence. But MD and AS have same precedence, in that case you must look for associativity and for these operators it is from left to right as shown to you by Aakaanksha šŸ’•
22nd Oct 2020, 7:42 AM
Avinesh
Avinesh - avatar
0
I'm so greatful Aakaanksha
23rd Oct 2020, 2:44 PM
Sri Laya
Sri Laya - avatar