0

can anyone explain me the operator precedence

24th Aug 2017, 11:32 AM
Prateek_ _Saxena
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
25th Aug 2017, 1:44 AM
Daniel
Daniel - avatar
+ 2
I hope you could understand ;-)
25th Aug 2017, 1:59 AM
Daniel
Daniel - avatar
+ 1
This is basic maths. Division and product are first and next add and sub. You can use parenthesis to change precedence.
25th Aug 2017, 1:31 AM
Daniel
Daniel - avatar
+ 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
25th Aug 2017, 1:43 AM
Daniel
Daniel - avatar
+ 1
thanxxxx
25th Aug 2017, 9:53 AM
Prateek_ _Saxena