Conversion of decimal To Binary c++ Program

 Conversion of decimal To Binary


Coding :

#include <conio.h>
#include<iostream.h>
int dec(int a )
{
int num=0,i=1,dec,rem;
cout<<" Binary form is ==== ";   
while(a!=0)
{

rem=a%2;
num=num+(i*rem);
a=a/2;
i=i*10;   
}

cout<<num;
}

int main()
{
cout<<"                   <<<<<< Conversion of Decimal to Binary >>>>>>"  <<endl;   
system("Color 43");   
int a;   
cout<<"Enter decimal number ===";
cin>>a;
cout<<"\n";
dec(a);
cout<<endl<<endl;
}

Share on Google Plus

About Unknown

This is a short description in the author block about the author. You edit it by entering text in the "Biographical Info" field in the user admin panel.
    Blogger Comment
    Facebook Comment

0 comments:

Post a Comment

Powered by Blogger.

Translate

 
 
.