I'm trying to create a program that converts binary numbers to decimal.
then i ran the program for a test.
i entered an input of 1010,then i get a result of 5. then,
i tried to solve it by using a calculator and get a result of 10.
why is that..?
int ctr, sum;
sum = 0;
sum = sum * 2 + 1;
sum = sum * 2;