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.
#define CHAR_BITS 8
void displayBits(unsigned int n){
int sup = CHAR_BITS*sizeof(int);
while(sup >= 0)
{
if(n & (((long int)1) << sup) )
printf("1");
else
printf("0");
sup--;
}
printf("\n");
return;
}