answersLogoWhite

0

Its is inputted by the user...!!!

anyways the program to convert the binary equivalent of a decimal number is as follows:

#include

#include

void main()

{ int i,n,j,b[100];
clrscr();
printf("Enter a Number:");
scanf("%d",&n);
i=0;
while(n>0)
{
b[i]=n%2;
n=n/2;
i++;
}
printf("\n\nBinary Equivalent:");
j=i-1;
for(i=j;j>=0;j--)
printf("%d",b[j]);
getch();
}

using this algorithms... the binary equivalent of any number is taken out...!!! enjoy... have any query... email at :- "devilllcreature@Yahoo.com" thank you....!!!

User Avatar

Wiki User

15y ago

What else can I help you with?