Program to convert
decimal to binary using recursion
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);
}
}
No comments:
Post a Comment