New course! Every coder should learn Generative AI!
Try a free lesson0
n=7; x=--n-n---; and y=(n--)-(--n);
plese tell me how to solve
1 Answer
+ 1
x = 0
y = 2
when you have --n you decrement the value of n and then consider it into your operation. (so, if you have --5, you consider 4)
when you have n-- you consider it, and THEN you decrement it. (so, if you have 5--, you consider it 5, but the next find you find it, it'll be a 4)
don't take that as 100% sure though. might be wrong since I'm not sure if increment and decrement's order is ruled by parenthesis.