I\'m converting an unsigned integer to binary using bitwise operators, and currently do integer & 1 to check if bit is 1 or 0 and output, then right shift by 1 to divide
you could move from left to right instead, that is shift a one from the MSB to the LSB, for example:
unsigned n = 20543; unsigned x = 1<<31; while (x) { printf("%u ", (x&n)!=0); x = x>>1; }