Man of few words said, look at the following code to achieve
#include <stdio.h>
#include <string.h>
void dectobin(int n)
{
if (n == 0)
return;
else
{
dectobin(n / 2);
printf("%d", n % 2);
}
}
int main()
{
int n;
scanf_s("%d", &n);
dectobin(n);
return 0;
}
Oh, welcome to discuss