C Program to convert Decimal to Binary


#include<stdio.h>
#include<conio.h>
#include<math.h>
void main()
{
int n,z=0,i,a[20];
clrscr();
printf("Enter the n value");
scanf("%d",&n);
while(n>0)
{
a[z]=n%2;
z++;
n=n/2;
}
for(i=z;i>=0;i--)
{
printf("%d",a[i]);
}
getch();
}