#include<stdio.h>
int main()
{
int i=1, anik, rob, sum = 0, n;
printf("Enter any number : ");
scanf("%d", &n);
rob = n;
while(n != 0)
{
anik = n%2;
n = n/2;
sum = sum + (anik * i);
i = i * 10;
}
printf("For %d Decimal Number to Binary Number : %d\n", rob, sum);
return 0;
}
int main()
{
int i=1, anik, rob, sum = 0, n;
printf("Enter any number : ");
scanf("%d", &n);
rob = n;
while(n != 0)
{
anik = n%2;
n = n/2;
sum = sum + (anik * i);
i = i * 10;
}
printf("For %d Decimal Number to Binary Number : %d\n", rob, sum);
return 0;
}
Comments
Post a Comment