need help with logics

You can, in fact, count on operator precedence. Guaranteed.

But most people don’t bother to learn the rules that the compiler STRICTLY follows.