i recently started typing the code for the program to convert a binary number to its decimal form and i got stuck when my compiler reported this error.
this is what i have typed till now.
#include<iostream>
using namespace std;
#include<math.h>
main()
{
int n,s=0,k=0,a,b,c;
cout<<"\n\n\tPROGRAM TO CONVERT BINARY TO DECIMAL";
cout<<"\ngive number: ";
cin>>n;
b=n;
while(n!=0)
{
n=n/10;
s+=1;
}
for(int i=s;i>+1;i--)
{
a=b%(pow(10,s-1));
c=pow(2,s-i);
k=k+c;
}
cout<<k<<"\n";
return 0;
}
error:invalid operands of typed 'int' and 'double' to binary 'operator%'