Technical Discussion :: C
Home > Technical Interview Q&A > C > Discussion
23 / 123
Which bitwise operator is suitable for turning OFF a particular bit in a number?
Answer:
The bitwise operator xor i.e '^' is used to turn off a particular number
by performing the following operations say we want to turn the ith bit off in a number n
then n = n^(1<<i)
Asked In ::
The bitwise operator xor i.e '^' is used to turn off a particular number
by performing the following operations say we want to turn the ith bit off in a number n
then n = n^(1<<i)