-3

Please have a look at the following code:

#include <stdio.h>
void main(){
    int i = 2;
    i = i++;
    printf("%d",i);
}

I expected the answer to be 3, but it comes out to be 2. Could someone please explain why?

Aevo
  • 70
  • 6

0 Answers0