Operators Associativity
The orders in which the operators that have the same precedence are evaluated is called the operators associativity. For example, operators * and / have the same precedence. Similarly, the operators + and - have the same precedence. In this case, the operations are performed from left to right.
The expression ( 4 * 5 ) / 10 ia evaluated as follows:
- 4 * 5 is evaluated first and returns 20.
- 20/10 is evaluated and returns 2.
No comments:
Post a Comment
Thanks For Visiting Here...!! I will Reply you as soon as possible.