0

do multiplication and division have same operator precedence in c++

if they have same precedence than how this expression is going to be evaluated a= num*x/y; and this one a=x/y*num;

16th Aug 2018, 3:58 PM
Teddy
Teddy - avatar
4 Answers
+ 5
incase of multiplication and division they have same precedence but they are evaluated from left to right first
17th Aug 2018, 8:23 AM
blACk sh4d0w
blACk sh4d0w - avatar
+ 2
iirc when it comes to multiplication and division the expression is evaluated left-to-right
16th Aug 2018, 5:27 PM
hinanawi
hinanawi - avatar
0
test it cout << a;
16th Aug 2018, 4:12 PM
LordHill
LordHill - avatar