Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- void BIT(unsigned value)
- {
- int i;
- for (i = 7; i >= 0; i--)
- {
- if (i == 3)
- {
- cout << " ";
- };
- char vs = (1 << i) & value;
- if (vs)
- {
- cout << "1";
- }
- else
- {
- cout << "0";
- }
- }
- }
- int main()
- {
- BIT(213);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement