//C++ Prog to convert a binary number to decimal
#include 
#include 
#include 

int main()
{
      int bin,dec=0,d,c=0,i,temp,bx;

      clrscr();

      cout<<"Enter a binary number: ";
      cin>>bin;      i=bin;
      while(bin!=0)
      {
       bx=bin%10;
       dec+=(bx*pow(2,c));
       bin/=10;
       c++;
      }
      cout<<"\nDecimal of "<

    Source: geocities.com/cplusplussurvivalkit