How about these lines?
x==0;
x==1;
Did you change those to 1 = sign?
Here's another question for your logic flow:
This line,
while (x==0);
is the same as having
while (x==0){
// hang out here until x changes to not a 0
}
but you have no code that can change x to not a 0. What is the plan to let something change x?
You have the same later on with
while (x==1);