C++ Program to Convert Decimal to Binary in Reversed Form andrey суббота, 18 октября 2014 г. No Comment

C++ Program to Convert a Decimal number to its Binary equivalent. The result produced after executing the source code will be in a reversed form.

Also Read: C++ Program to Check If a Character is Small, Capital, Number or Special Character

C++ Program to Convert Decimal to Binary in Reversed Form



#include 
#include
int main()
{
int n;
cout<<"enter a decimal number to convert to binary: ";
while (cin >> n)
{
if (n > 0)
{
cout <<"binary equivalent of "<<n<<" in reverse order is: ";

while (n > 0)
{
cout << n%2;
n = n/2;
}

}
else
{
cout << "Please enter a number greater than zero." << endl;
}
}
return 0;
}

Also Read: C++ Program For Binary Equivalent Of A Decimal Number
C++ Program to Convert a Decimal number to its Binary equivalent. The result produced after executing the source code will be in a reversed form.

Also Read: C++ Program to Check If a Character is Small, Capital, Number or Special Character

C++ Program to Convert Decimal to Binary in Reversed Form



#include 
#include
int main()
{
int n;
cout<<"enter a decimal number to convert to binary: ";
while (cin >> n)
{
if (n > 0)
{
cout <<"binary equivalent of "<<n<<" in reverse order is: ";

while (n > 0)
{
cout << n%2;
n = n/2;
}

}
else
{
cout << "Please enter a number greater than zero." << endl;
}
}
return 0;
}

Also Read: C++ Program For Binary Equivalent Of A Decimal Number
by Jillur Rahman

Jillur Rahman is a Web designers. He enjoys to make blogger templates. He always try to make modern and 3D looking Templates. You can by his templates from Themeforest.

Follow him @ Twitter | Facebook | Google Plus

No Comment