#include
#include
void main()
{
clrscr();
unsigned long int y,i=0,j=0,r,k[50];
unsigned long a,x,b[50];
cout<<"\nEnter a decimal no. ";</span>
cin>>a;
y=a;
x=a-y;
while(y>0)
{
r=y%2;
k[i]=r; i++;
y=y/2;
}
int m=0;
while(m<10)<br>{
x=x*2;
b[j]=int(x);
j++;
m++;
if(x>1)
x=x-1;
else
if(x==0)
break;
}
cout<<"\nDecimal no. "<<a<<" = ";<br>if(a>1)
{
for(int e=i-1;e>=0;e--)
cout<<k[e];<br>cout<<".";<br>for(int g=0;gcout<<b[g];<br>}
else
{
cout<<"0.";<br>for(int f=0;fcout<<b[f];<br>}
cout<<" in binary no. system";<br>getch();
}