You are converting from binary to binary? That doesn't make much sense. If you are going from binary to decimal that is pretty easy. Just loop over the digits and add 1 to a counter if the digit is a 1. When the loop moves to the next digit multiply by 2.
Are you doing all these problems for a class?
|