#include<iostream.h>
#include<conio.h>
int main ()
{
int num,i=0;
cout<<"Enter the decimal number:";
cin>> num;
while(num>0)
{
i=num%2;
num=num/2; cout<<i;
}
cout<<"(Result in reverse order)";
getch ();
return 0;
}
#include<conio.h>
int main ()
{
int num,i=0;
cout<<"Enter the decimal number:";
cin>> num;
while(num>0)
{
i=num%2;
num=num/2; cout<<i;
}
cout<<"(Result in reverse order)";
getch ();
return 0;
}
No comments:
Post a Comment