Trying to make a program with binary numbers that turn into decimals. i got the first digit, but am stuck trying to isolate to second digit to turn into dec. any help?
Code:#include <iostream> using namespace std; int main() { unsigned number; unsigned count= 0; cout<<"Please enter in a binary number, and I will give you the number "; cout<< "in decimal form"<<endl; cin>>number; while (number=number%10) { if (number == 0) count = count + 0; if(number==1) count = count + 1; break; } while(number=number%100) { if (number == 0) count = count + 0; if (number == 1) count = count +2; break; } cout<<count; system("pause"); return 0; }