Wap to find BINNARY number of any Decimal Number

#include<conio.h>
#include<stdio.h>
void main()
{

int num,r;
clrscr();

printf("\nEnter the number");
scanf("%d",&num);

 r=num%2;
 num=num/2;
 if(num==0)
 {
  printf("\nThe binary euivalent is %d",r);

 }
 else
 {
 binary(num);
 printf("%d",r);
 getch();
}

No comments:

Post a Comment