Dũng

3 bundles
1 file15 days ago
1

Print all bits in an int.

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