Write A Program To Convert Decimal To Binary In Simple c.
#include<stdio.h>
#include <conio.h>
void Decimal_To_Binary (int n);
main ()
{
int n;
printf ("Enter decimal number to convert it binary.\n");
scanf ("%d", &n);
printf ("The %d binary is = ", n);
Decimal_To_Binary (n);
getch();
}
void Decimal_To_Binary (int n)
{
if (n > 1)
{
Decimal_To_Binary ((n / 2));
}
printf ("%d", (n % 2));
}
#include <conio.h>
void Decimal_To_Binary (int n);
main ()
{
int n;
printf ("Enter decimal number to convert it binary.\n");
scanf ("%d", &n);
printf ("The %d binary is = ", n);
Decimal_To_Binary (n);
getch();
}
void Decimal_To_Binary (int n)
{
if (n > 1)
{
Decimal_To_Binary ((n / 2));
}
printf ("%d", (n % 2));
}