0
can anyone explain me the operator precedence
5 odpowiedzi
+ 2
and if you talk about increment and decrement
a=3
b=2
b+a=5
++b +a = 3+3=6; b=3; a=3
b + a++ = 2+3=5; b=3; a=4
b-- +a = 2+3=5; b=1; a=3
b + a-- = 2+3=5; b=2; a=2
+ 2
I hope you could understand ;-)
+ 1
This is basic maths.
Division and product are first and next add and sub.
You can use parenthesis to change precedence.
+ 1
5+3*5-4 = 5+15-4 = 16
(5+3)*5-4 = 8*5-4 = 40-4 = 36
5+3*(5-4) = 5+3*1 = 5+3 = 8
+ 1
thanxxxx