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