Discussion
A bit is to be cleared without disturbing the others. The correct line is
Answer: C
Correct answer: reg &= ~(1u << n);
Shifting one into position and inverting gives a mask with a zero at that bit and ones everywhere else; ANDing with it clears the bit and leaves the rest untouched. OR would set the bit, XOR would toggle it, and plain assignment would destroy every other bit in the register.
No comment is present. Be the first to comment.
Loading…
Post your comment
Please log in or register to post a comment.
Examination Categories
- SSC Exams
- Banking Exams
- Teaching Exams
- Civil Services Exams
- Railways Exams
- Engineering Recruitment Exams
- Defence Exams
- State Government Exams
- Police Exams
- Insurance Exams
- Nursing Exams
- Other Government Exams
- NRA CET
- PG Entrance Exams
- Campus Placement
- MBA Entrance Exams
- CUET and UG Entrance
- Judiciary Exams
- Regulatory Body Exams
- Software Development