in case of i = i++;
i = ( return i and increment the value of i by 1)
initially i is 0 , the value to be returned is determined to be 0. then the value of i is incremented by 1 so i become 1 now the return happens which return the value 0.
the return happens after the value of i is incremented.
the defination of i++ is :- the current value of i is to be taken for evaluating the expression and after using its current value increment it by 1
the value of i is incremented before the returns happens
consider the following example
int i = 0 , j ;
j = i++ + i++;
the answer will be j = 1 and i = 2 and not j = 0 , this is because after using the value of i , it is incremented immediately so that the new value can be used in the next increment. after the whole expression is evaluated and the increment being done , then the value of the expression is returned to the left hand side variable.
I hope that i have made myself clear.