Variables displayed incorrectly
Do you know what int a; does?

For example you have a global variable a and then you have local a. Local one hides global one.

In all cases you're changing local variables. Then you're printing global a,b,c and local d.