0

Clarify me plz

int x=10; x=x++; // here now 10 and then incremented printf("%d",x); // wen it comes here it should be 11 right ..coz it's incremented but the output is 10 not 11 ..how ??

16th Nov 2017, 12:40 AM
corejava
4 Réponses
+ 6
First, it takes the old x value. Then, it increments x by one. Finally, it assigns it to the old x value.
16th Nov 2017, 12:41 AM
qwerty
qwerty - avatar
+ 6
@corejava I edited my comment so I could explain it better. You should understand what I mean now.
16th Nov 2017, 12:46 AM
qwerty
qwerty - avatar
+ 1
thanks buddy explain me another program plz
16th Nov 2017, 12:56 AM
corejava
0
it's x++ here it will increment and wen it will comes to printf it will be 11 na ...y 10...I don't get this
16th Nov 2017, 12:43 AM
corejava