Conversion from binary to decimalfor n binary numbers

HI , my problem is the no. keep on multiplying.
plz check my code.

You are using wrong approach in your code for conversion,
int ans=0;
int pos=1;
while(N>0)
{
int rem=N%10;
ans=ans+rempos;
N=N/10;
pos=pos
2;
}
cout<<ans<<endl;
}

Plz modify your code accordingly.