static void print_bits(int bits, int newline) { size_t tip = CHAR_BIT * sizeof(int); while (tip--) { putc( ((bits >> tip) & 1) ? '1' : '0' , stdout); } if(newline) putc('\n', stdout); }