n=7; x=--n-n---; and y=(n--)-(--n); | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

n=7; x=--n-n---; and y=(n--)-(--n);

plese tell me how to solve

30th Aug 2017, 4:20 PM
Gyandeep kumar
Gyandeep kumar - avatar
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.
30th Aug 2017, 5:30 PM
Michael Vigato
Michael Vigato - avatar