[Solved] Order of arithmetic operator execution C++


The operator precedence of C++ is the standard mathematical precedence, where % has the same precedence as /.

So, the expression m = 605 / 10 + 45 % 7 + 29 % 11; would be evaluated as

m = (605 / 10) + (45 % 7) + (29 % 11);

Which would result in:

m = (605 / 10) + (45 % 7) + (29 % 11);
m = 60 + 3 +7;
m = 70;

3

solved Order of arithmetic operator execution C++