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
radixSort
Unqualified free functions
Example
Linker error while passing constexpr variable as const &
my override
mine
Throttle Example using circular queue (push all but 2 less than maxSize; then pop all but 2 less than current size)
problem_name_2
MPL 2-1
Graphs Iteration 2.1 Directed Graphs