
Asked in RadiSys
Write an expression to clear the nth bit in a number.

AnswerBot
2y
Expression to clear nth bit in a number
Use bitwise AND operator with the complement of 2 raised to the nth power
Example: To clear 3rd bit of 1010, use 1010 & ~(1<<3) = 1000
Help your peers!
Add answer anonymously...
Top Platform Engineer Lead Interview Questions Asked at RadiSys
Q. What are mutexes and semaphores?
Q. Write a program to delete a node in a singly linked list.
Q. Write an expression to clear the nth bit in a number.
Interview Questions Asked to Platform Engineer Lead at Other Companies
Stay ahead in your career. Get AmbitionBox app


Trusted by over 1.5 Crore job seekers to find their right fit company
80 L+
Reviews
10L+
Interviews
4 Cr+
Salaries
1.5 Cr+
Users
Contribute to help millions
AmbitionBox Awards
Get AmbitionBox app

