Maybe the point of this task is to use arithmetic operations instead of the bitwise ones?Here is an example:
void printByteBits(unsigned char num){ const static int div[8] = {1, 2, 4, 8, 16, 32, 64, 128}; for (int i = 0; i < sizeof(div)/sizeof(div[0]); i++) { printf("Bit %d: %d\n", i, (num / div[i]) % 2); }}
See the output here: https://godbolt.org/z/xUC663