#include<stdio.h>
#include<conio.h>
void binary(int val);
void main()
{
    int a,b;
    //clrscr();
    printf("Enter the number in decimal:");
    scanf("%d",&a);
    printf("Number in Binary form: ");
    binary(a);
    getch();
}
void binary(int val)
{
    int r;
    r=val%2;
    val=val/2;
    if(val==0)
    {
        printf("%d",r);
    }
    else
    {
        binary(val);
        printf("%d",r);
    }
}

OUTPUT:


Enter the number in decimal:10
Number in Binary form: 1010