write a brief note on operators precedence and associativity
Answers
Answer:
Operator precedence: It dictates the order of evaluation of operators in an expression. Associativity: It defines the order in which operators of the same precedence are evaluated in an expression. ... Operators that appear in the same group have the same precedence.
Explanation:
follow
Answer:
Operator precedence determines which operator is performed first in an expression with more than one operators with different precedence.
Explanation:
Operators Associativity is used when two operators of same precedence appear in an expression. Associativity can be either Left to Right or Right to Left.
For example: ‘*’ and ‘/’ have same precedence and their associativity is Left to Right, so the expression “100 / 10 * 10” is treated as “(100 / 10) * 10”.