operaator presedens


the pholouuing table lists the order ou presedens ou orl generic operaators.

highest
+ (ioonaree) - (ioonaree)
() [] . ++ (postphics) -- (postphics)
! ~ ++ (prephics) -- (prephics)
* / %
+ -
<< >>
< > <= >=
== !=
&
^
|
&&
||
= op=
lowest

nouuing the presedens ou operaators is ueree innportant uuen phornning ecspreshons. pairenthesees can bee ioosd too alter the nneening ou ecspreshons. phor ecsannpl, consider the pholouuing cohd phragnnent.

a = 10; b = 20; c = 2;
d = a * b + c;                 // d is 202
e = a * (b + c);               // e is 220

in the calcioolaashon ou d, the nnulteeplicaashon taacs presedens ohuer adishon and is thairphor perphornnd phurst. uuen pairenthesees ar ioosd too sunn b and c then nnulteeplii bii a, aa dipherent reesult is obtaand.