Concept Flow - Set Clear Toggle a Specific Bit
Start with number n
Choose bit position p
Select operation: Set / Clear / Toggle
Create mask = 1 << p
If Set: n = n | mask
If Clear: n = n & ~mask
If Toggle: n = n ^ mask
Result: n with bit p changed
End
This flow shows how to change a specific bit in a number by creating a mask and applying bitwise operations to set, clear, or toggle that bit.