Write a code to convert Decimal to Binary
#include<stdio.h>
#include<math.h>
void main()
{
int number = 25;
int binary = 0;
int count = 1;
int Mod = 0;
while(number != 0)
{
Mod = number % 2;
number = number/2;
binary = binary + Mod*count;
count = count*10;
}
printf("%d",binary);
}
0 Comments