0
Thats how it should be after using namespace std; line. void binary_to_decimal() { long bool1; int decimal=0,i=0; cout<<"inter any binary decimal"<<endl; cin>>bool1; while (bool1 != 0 ) { decimal=decimal + ((bool1 %10)*pow(2,i)); i++; bool1=bool1/10; } cout<<"the decimal equivelent is "<<decimal<<endl; } int main() { binary_to_decimal (); }
10th May 2020, 4:02 PM
Mustafa K.
Mustafa K. - avatar