Having trouble understanding "scope"

I am not pro, but I don't get why you are re-declaring the type

int k = k-4;

when you have defined it as global variable

int n = 0;
int i = 5;
int k = 0;