#include<stdio.h>
main()
{
int r,l=0;
long n=0,bin=0,s=0,t;
clrscr();
printf("\nEnter a Decimal Value:\n");
scanf("%ld",&n);
t=n;
while(t>0)
{
r=t%2;
s=s*10+r;
t=t/2;
l++;
}
while(l>0)
{
r=s%10;
bin=bin*10+r;
s=s/10;
l--;
}
printf("\nBinary equivalent of %ld is %ld",n,bin);
getch();
}