0
Why the first output is 1 0 but the second is 0 1??
4 Réponses
+ 4
increment operation in printf is done from right to left
+ 2
the problem is that, it's incremented normally, but printed in reverse, though I haven't figure out why it work that way, but that's how it works, let me call on my guru ~ swim ~ to shed more light on this
0
But then shouldn't the second printf give 0 0 as the second printf is (i++,i)??
0
It's because when you first use I, i++ at that time first value is look like this
0, 0++ so in this statement I=0 is post increment by 0++ so value of i become 1 but 0++ is still give 0
So output 1 , 0
In other statement i++, i
0++, 0
First statement 0++ will give 0 and next time post increment give 1 so output comes as 0, 1