+ 5
Doubt
If `%` operator has highest precedence then why 5*4%3 results 2 in many languages instead of 5.
2 Réponses
+ 9
Since multiplication and division have the same precedence, they are evaluated from left to right.
+ 2
Because in many languages '%' it have the same precedence as '*' and thus, 5*4%3 starts with '*' first instead of '%'