Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
Program_3
#include <iostream> using namespace std; void printBinary(unsigned int myNumber) { int numberOfBits = sizeof(unsigned int)*8; for (int i=numberOfBits-1; i>=0; i--) { bool isBitSet = (myNumber & (1<<i)); if (isBitSet) { cout << "1"; } else { cout << "0"; } } } int main(void) { unsigned int number; cout << "Enter the integer number:"; cin >> number; cout << endl << "The number you have Entered in decimal is: " << number << endl; cout << " number input is in binary: "; printBinary(number); cout << endl << "That is the conversion" << endl; return 0; }
run
|
edit
|
history
|
help
0
What's the problem with this?
general
selection sort
ghfhfgh
Task on Задача C. Белочка
Namespace scope qualifier
cv5_class
Peregruzka
Assertion Divide by Zero Example
Vector examples....