0

Who can explan me

I have the next code but I don't understand it int a=2; int =1; cout << (++a/b++)*5; The answer is 15 could you help me?

24th Jan 2017, 2:33 AM
bri
bri - avatar
4 Réponses
+ 8
Well, ++a makes a = 3. b++ makes b two, but only after division and other operators. So for our purpose, b++ is still 1. Therefore (++a/b++)*5 becomes (3/1)*5 which is 15. I hope this helps.
24th Jan 2017, 2:40 AM
J.G.
J.G. - avatar
+ 4
Great answer Kartikeya Kotnala.
24th Jan 2017, 2:54 AM
J.G.
J.G. - avatar
+ 2
👆he is right
24th Jan 2017, 2:53 AM
Kartikeya Kotnala
Kartikeya Kotnala - avatar
+ 1
Thanks
24th Jan 2017, 2:55 AM
bri
bri - avatar