Code Testing for binary to decimal conversion program

i have written the following code in c++ for the binary to decimal conversion program can you please tell why this isnt working

#include
#include<math.h>
#include<bits/stdc++.h>
using namespace std;

int main()
{
int a;
int sum=0;
int mul=0;
cout<<“enter the binary number”<<endl;
cin>>a;

while(sum=+scanf("%d",&a)!=EOF)	{
	
	mul=mul+a*pow(2,sum);
}

cout<<"the decimal representation of above binary number is:"<<mul<<endl;
return 0;

}