#include <iostream>
using namespace std;

int main() {
    int zahl = 5;
    //cin >> zahl;
    int anzahlDerBytes = sizeof zahl; //4
    int anzahlDerBits = 8 * anzahlDerBytes; //32
    for(int k = anzahlDerBits-1; k >= 0 ; --k) {
    	cout << "k == "  << k << "; 1 << k ==  0b"  << string(anzahlDerBits-1-k, '0')  << '1' <<  string(k, '0') << "; " 
                 << zahl << " & (1 << k) == "  <<  (zahl & (1 << k))  << '\n';
        if(zahl & (1 << k)) {
            cout << "1\n";
        }
        else {
            cout << "0\n";
        }
    }
    cout << endl;
}
