How to write a C Program To Convert Decimal To Binary Using Recursion in C Programming Language ?
Solution For C Program :
#include<stdio.h>
void main()
{
void dectobin(int);
int n;
printf("\nEnter Any Decimal Number : ");
scanf("%d", &n);
dectobin(n);
}
void dectobin(int a)
{
int d;
d = a % 2;
if(a != 0)
{
dectobin(a / 2);
printf("%d", d);
}
}
You may also learn these C Program/Code :