#include<stdio.h>
#include<conio.h>
void main()
{ int num,rem,binary,count;
clrscr();
binary=0;
count=0;
printf("\nEnter any number: ");
scanf("%d",&num);
while(num>0)
{rem=num%2;
num/=2;
binary=rem+count;
count=binary*10;
}
printf("\n\n%d",binary);
getch();
}
Comments
Post a Comment