--- In [email protected],
Answer For "ruhatadiyaman" <ruhatadiya...@...> 

#include<stdio.h>
#include<math.h>
#include<conio.h>
void main()
{
int n,a[16],i=0,j,total=0,k,temp=1;
clrscr();
printf("\nenter  number in the binary form.\n");
scanf("%d",&n);
while(n!=0)
{
a[i]=n%10;
n=n/10;
i++;
}
k=i;
for(i=0;i<k;i++)
{
temp=pow(2,i);
temp=a[i]*temp;
total=total+temp;
}
printf("\nthe integer no is %d",total);
getch();
}

Reply via email to