math – Need help for beginners in Java

Hi there i am new in java,
I am trying to get result of this.
public class Main {

public static void main(String() args) {
    int a=9+3;
    int b=a-2;
    int  c=b*4;
    int d=c/2;
    int e=++d;
    int  f=--e;
  int g=e%3;
    System.out.println("a:"+a+" "+"b:"+b+ " "+"c:"+c+" "+"d:"+d+" "+"e:"+e +"f:"+f+" "+"g:"+g);
}

}
it gets this answer:a:12 b:10 c:40 d:21 e:20f:20 g:2
why am i getting this result??d must be 20 and e must be 21
if i change d and e into this

public static void main(String() args) {
    int a=9+3;
    int b=a-2;
    int  c=b*4;
    int d=c/2;
    int e=d++;
    int  f=e--;
  int g=e%3;
    System.out.println("a:"+a+" "+"b:"+b+ " "+"c:"+c+" "+"d:"+d+" "+"e:"+e+""+"f:"+f+" "+"g:"+g);

}

i get result of a:12 b:10 c:40 d:21 e:19f:20 g:1
I know it is very simple and basic but i cant figure why?Please someone help me.