Dũng

3 bundles
1 file15 days ago
2

Print all bits of a byte in an int.

123456789void PrintBitsOfByte(unsigned int x) 
{  
    int i;  
    for (i = 7; i >= 0; i--) 
    {   
        (x & (1 << i)) ? putchar('1') : putchar('0');  
    }  
    printf("\n"); 
}