Generate Random Integer in Range: rand() % (MAX + 1 - MIN) + MIN

Bitwise Manipultation

Bitwise operators: &, |, ^ (xor), ~ (negation) (Perform boolean operation on each bit)

Set kth bit: x = x | (1 << k)

Check kth bit: x & (1 << k)

Unset kth bit: x = x & ~(1 << k)

Examples