operaator presedens


the pholouuing table lists the order ou presedens ou orl c# operaators.

highest
() [] . ++ (postphics) -- (postphics) checd nioo siis_ou tiip_ou unchecd ::
! ~ (cast) + (ioonaree) - (ioonaree) ++ (prephics) -- (prephics)
* / %
+ -
<< >>
< > <= >= is as
== !=
&
^
|
&&
||
?:
= 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.

integer a = 10, b = 20, c = 2;
integer d = a * b + c;                 // d is 202
integer 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.