Trying to print "occur = 1" in an if statement but it wont work
Remove the int from inside the if and else statement. The code would always show 0 because access of occur, which is assigned value 1 or 2 is limited to the if..else statement. So the global occur remains 0 always.

So change it to:

if (Switch == 1){
 Occur = 1;
}
else {
 Occur = 2;
}


This will work.