Hello friends,in programming, an associative operation occurs when no grouping is present, where operators that have the same precedence (addition and subtraction) will be evaluated either from left to right (left-associative) or from right to left (right-associative).
For example:If no grouping(parentheses) is present than 4-3+1 give the result 2 because here we start calculation from left but if grouping is present ie 4-(3+1) then result is 0 because we first calculate (3+1).
In most programming languages, the addition, subtraction, multiplication, and division operators are left-associative, while the assignment, conditional, and exponentiation operators are right associative.
Thanks Friends........
No comments:
Post a Comment
Please Give Me Your Views