Question DSA-BIT-0079
HardHow do you swap the nibbles (4-bit halves) of a byte x?
- A.
x >> 4
- B.
x ^ 0xFF
- C.
Sign up free to see the answer and a step-by-step explanation.
Popular companies
Prepare company by company
Hiring pattern, syllabus, past questions and mocks for each company.
All companiesPractice by subject
Bit Manipulation question
How do you swap the nibbles (4-bit halves) of a byte x?
x >> 4
x ^ 0xFF
Sign up free to see the answer and a step-by-step explanation.
x << 4
((x & 0x0F) << 4) | ((x & 0xF0) >> 4)