0

Can someone ecplain why the outcome is like that

https://code.sololearn.com/cEnmdBcZjVUq/?ref=app so i made a code about it but have a hard time making a 100% answer just base on the outcome so i have to ask just to make sure. thank you

14th Oct 2017, 2:12 PM
Charles Atienza
Charles Atienza - avatar
2 Answers
+ 3
1) int a = 3; //a=3 2) int b = a++; //b=3;a=4 3) int c = ++a; //c=5;a=5 4) int d = a++; //d=5;a=6 Which step you don't understand?
14th Oct 2017, 2:18 PM
deFault
0
what i'm thinking is that it should add only on what is called? but i guess not... a++ should always be 4 something like that I guess I was sleepy when i tried to understand it.. i got it now thank you
18th Oct 2017, 6:59 PM
Charles Atienza
Charles Atienza - avatar