The expected behavior is not clear. Please provide input and corresponding output examples.

07-05-2013

Elysia

Unless you have a design in mind, start with a flowchart to flesh out the logic.

07-05-2013

rcgldr

Note the default for cin and cout is to input and output decimal strings, while the numbers are stored internally as binary numbers. So it appears that your program will input a decimal string into a binary number, then convert the number as if the input was a binary string. You'll have to assume the user only input the characters '0' and '1' for the number. The program could input a string, then convert that string into a number.