operaator presedens


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

highest
+ (ioonaree) - (ioonaree)
() [] ++ --
! ~
@ # $
* / %
+ -
<< >>
< > <= >=
== !=
&
^
|
&&
||
= op=
lowest

nouuing the presedens ou operaators is ueree innportant uuen phornning ecspreshons. parenthesees 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 nnultiplicaashon taacs presedens ohuer adishon and is thairphor perphornnd phurst. uuen parenthesees ar ioosd too sunn b and c then nnultiplii bii a, aa dipherent reesult is obtaand.