/ before *

closed account (EwCjE3v7)
I don`t understand why the / would be done before *?

 
  cout << 30 / 3 * 21 % 5 << endl;
* and / have the same level of precedence:

http://en.cppreference.com/w/cpp/language/operator_precedence

When operators have the same precedence, they are executed from left to right.
closed account (EwCjE3v7)
Oh that explains a lot, thank you Disch :D
Topic archived. No new replies allowed.