Challenge 1: Three Named Flags, Combined and Checked — Possible Solution ==================================================================== #include #define FLAG_READ (1 << 0) #define FLAG_WRITE (1 << 1) #define FLAG_EXEC (1 << 2) int main() { unsigned int perms = FLAG_READ | FLAG_WRITE | FLAG_EXEC; printf("READ: %s\n", (perms & FLAG_READ) ? "set" : "not set"); printf("WRITE: %s\n", (perms & FLAG_WRITE) ? "set" : "not set"); printf("EXEC: %s\n", (perms & FLAG_EXEC) ? "set" : "not set"); return 0; } Output: READ: set WRITE: set EXEC: set WHY THIS WORKS AS AN ANSWER ------------------------------ Each flag occupies a distinct bit position (1<<0, 1<<1, 1<<2 -- bits 0, 1, and 2 respectively), so OR-ing all three together sets each bit independently with no overlap or interference, exactly matching the chapter's own FLAG_A/FLAG_B/FLAG_C pattern; checking each one with AND against perms correctly isolates just that bit's contribution, confirming all three read as set.