DZone Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world
Binary To Decimal In C
program to convert binary number to decimal
#include <stdio.h>
#include <math.h>
main()
{
int bin,rem,n=0,sum=0;
printf("please enter binary number");
scanf("%d",&bin);
while(bin)
{
rem=bin%10;
sum=sum+(rem*pow(2,n));
bin=bin/10;
n++;
}
printf("%d\n",sum);
}
/*
by joseph dias
email josephdias92@gmail.com
*/





