diff --git a/binarytodecimal.cpp b/binarytodecimal.cpp new file mode 100644 index 0000000..1262b81 --- /dev/null +++ b/binarytodecimal.cpp @@ -0,0 +1,26 @@ +#include +#include +using namespace std; + +int main(){ + int num,i=0,remainder=0; + int dec=0; + cout<<"Enter the numbers u wan to input:"; + cin>>num; + + + + + while(num!=0){ + + remainder= num%10; + + dec= dec + remainder*pow(2,i++); + num=num/10; + } + cout<<"The decimal conversion of the number is:"; + cout<