Operators of the same priority are evaluated from left to right, so that Operators of the same priority are evaluated from left to right, so that
a – b – c
is evaluated as
( a – b ) – c ????????????????????/
Operators of the same priority are evaluated from left to right, so that Operators of the same priority are evaluated from left to right, so that
a – b – c
is evaluated as
( a – b ) – c ????????????????????/
EmbLogic Research & Competency Development Labs
Phone: +91 9818467776, 8527567776, 9650467776
Email: info@emblogic.com
Copyright © EmbLogic Embedded Technologies Pvt. Ltd.
In the case of same operator existing in the mathematical equation in C.
The complier will start to compile for left to right ( for your case).
and the complier will take it as
(a-b)-c;
To elaborate it more, in some case, different operator of same priority can exist in same equation.
ex: a=3/2*5;
Here / and * have same priority, so it is up to the complier to evaluate / first and * second and vica versa is also true.
So to overcome such a problem use brackets.
ex:
a=(3/2)*5; output : 5
a=3/(2*5); output : 0
Could you elaborate the question? So that it would help us to solve us more precisely.
sir actually he want assurance of his observation