Hi
You have ...
carry==1;
If you mean to set the variable carry to 1, the code should be ...
carry = 1;
Let us know what you get when you change this.
Also, we can't see where you assign an initial value to carry before getting to the code you posted. You need to make sure that it has a sensible value before you get to the if (carry == 0) conditional.
Hope this helps.