How to print bits in c

前端 未结 5 1189
礼貌的吻别
礼貌的吻别 2021-01-21 10:30

I\'m writing a function to print bits in c, I\'m only allowed to use write function. my function doesn\'t work for other numbers.

void    print_bit         


        
5条回答
  •  余生分开走
    2021-01-21 11:16

    #include
    
    int countOne =0;
    int countZero =0;
    
    void print_bits(int n,unsigned int num)
    {
       if(n == 31) return;
       print_bits(n+1,num);
       (num & (1<

提交回复
热议问题