if (x = 0);
Two problems right there
if (x = 1)
Only one there
Please remember to use code tags when posting code.