#include<stdio.h>
#include<conio.h>
#include<math.h>
void main()
{
int i,n,a[1000];
long num;
clrscr();
printf("Enter any decimal number : ");
scanf("%ld",&num);
n=0;
while(num>0)
{
a[n]=num%2;
num=num/2;
n++;
}
printf("\nEquivalent binary number is : ");
for(i=n-1;i>=0;i--)
printf("%d",a[i]);
getch();
}
///////////////////////////////////////////////////////////////////////////
Copy & paste this code in your TC & run, then you will get output.......
If you have any problem please comment below.........