Wait, no.. you're shifting the mask, not the variable. My mistake.
It's wrong because you're starting from the wrong side of the number. Start from the high order:
Main can just be main(void) since you aren't using any of the command lines. You must include stdio.h and for the sake of gods, use a for loop instead - it looks better.Code:int main()
{
unsigned int Mask = 0x80;
int count;
int x;
x = 0;
count = 'a';
for (x = 0; x < 8; x++)
{
if (count & Mask)
printf("1");
else
printf("0");
Mask >>= 1;
}
}

