Simple C program to convert a binary number to decimal number.
#include<stdio.h>
#include<math.h>
int main()
{
int n,decimal=0,i=0;
printf("Enter a binary number: ");
scanf("%d",&n);
while(n!=0)
{
decimal=decimal+pow(2,i)*(n%10);
n=n/10;
i++;
}
printf("Decimal number = %d",decimal);
return 0;
}