#include<stdio.h>
int main()
{
int a,b,f;
printf("Enter the decimal number\n");
scanf("%d",&a);
printf("Binary of %d is\n",a);
while(a>0)
{
b=a%2;
a=a/2;
f=f*10+b;
}
printf("%d",f);
}
OUTPUT
Enter the decimal number
15
Binary of 15 is
1111
Visit Homepage
Comments
Post a Comment