/*******************************************************
Program to convert a decimal number to a binary number
******************************************************/
#include<stdio.h> // include stdio.h library
#include<math.h> // include math.h library
int main(void)
{
long long num, bin = 0;
int i = 0, rem;
printf("Enter a decimal number: \n");
scanf("%lld", &num);
while(num != 0)
{
rem = num % 2; // get the remainder
bin = rem * (long long)pow(10, i++) + bin;
num /= 2; // get the quotient
}
printf("%lld", bin);
return 0; // return 0 to operating system
}