--- In [email protected], "ruhatadiyaman" <ruhatadiya...@...> If you dont have any problems them plz next time give me your e-mail, so I can directly mail you, here is your solution:
#include <stdio.h>
#include <conio.h>
#include <math.h>
void main()
{
int b,d=0,i=0,j=0,k;
clrscr();
printf("Enter any Binary Number.\n");
scanf("%d",&b);
k=b;
if(b!=0)
{
while(b!=0)
{
i=b%10;
d=d+(i*pow(2,j));
b=b/10;
j++;
}
printf("Binary %d = Decimal %d",k,d);
}
else
printf("\nYou entered 0.");
getch();
}
