#include <iostream>
using namespace std;
/* run this program using the console pauser or add your own getch, system("pause") or input loop */
int main(int argc, char** argv) {
int biner,aku=0,dua=1;
cout<<"Masukan Bilangan BINER : ";cin>>biner;
do { aku+=(biner%2)*dua;dua*=2;biner/=10;}
while(biner);
cout<<"bilangan DESIMAL nya adalah "<<aku;
return 0;
}
Comments
Post a Comment