Both i++ and ++i will increase i by one. The difference is that i++ will return the value of i before i was increased while ++i will return the value of i after i has been increased.
So in your code x will get the value 45, but if you change line 5 to x = ++z; you will see that both x and z will have the same value.
what does this actually mean? It means "assign the value of x to y and immediately after assigning 12 to y, x gets incremented by 1", therefore y==12 and x changes immediately to 13. But what if you say
1 2
x=12;
y=++x;
It means, "first of all, increment x by 1, which makes x=13, then assign x's new value to y." So it makes them both 13.