You need to learn to indent properly.

Also, the warning is a little misleading. The big problem is that you are assigning instead of comparing.

But even then, it doesn't make sense, since i is initially 0, and the loop executes only while i equals 4. Hence, the loop won't run.

Also, your code is way overcomplicated. I think you should formulate proper logic for this first.

The method is the same if you add 5 bits as if you were adding n bits.

It's just as usual addition, but in base 2 instead of base 10.