title: How to print a decimal into a 32 binary separating it 8 bits
body: <p>I am trying to print a 32 binary integer with 8 bits separated by a space. ex (00000000 00000000) Then the result should be used for future testing which I will integrate 512 for example as y. </p>
  
  <pre><code>  #define CHAR_BITS 8
  
  void displayBits(unsigned int n){
  
  
  int sup = CHAR_BITS*sizeof(int);
  while(sup &gt;= 0)
  {
      if(n &amp; (((long int)1) &lt;&lt; sup) )
          printf("1");
      else
          printf("0");
      sup--;
  
  
  }
  printf("\n");
  
  return;
  }
  </code></pre>