VON NEUMAN LOVES BINARY Doubt

something went wrong with my code can you please check it

https://ide.codingblocks.com/s/102463 Here is the code

Hello @Ajitverma1503,

There are two mistakes in your code.

Let’s understand them with the help of an example:
2
111
101
Expected Output:
7
5

What would be the value of dec once converting 111 to 7? Check.
What should be the value of dec before the start of second binary number 101? Think.

What would be the value of b once converting 111 to 7? Check.
What should be the value of b before the start of second binary number 101? Think.

Hope, this would help.
Give a like, if you are satisfied.

1 Like