Convert Binary To Decimal Number

in Hindi - Convert Binary To Decimal Number



not yet

Source Code :

RUN#include<iostream.h>
#include <conio.h>
#include<math.h>

int main()
{
int num, rem=0, num1=0, i=0;
cout<<"Enter binary value(0 and 1): ";
cin>>num;

while(num > 0){
rem = num % 10;
num1 = num1 + rem * pow(2, i);
i++;
num = num / 10 ;
}
cout<<"Decimal number "<<num1;

return 0;
}