Bit Manipulation/Mask Flashcards

Review bit masking

1
Q

What is the result of the following C operation?

Write your answer in hexadecimal. 0x5B ^ 0xC2

A

Answer: 0x99

0x5B == 0101 1011
0xC2 == 1100 0010
——————————-
0x99 == 1001 1001

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What is the result of the following C operation?

Write your answer in hexadecimal. 0x5B&0xC2

A

Answer: 0x42

0x5B == 0101 1011
0xC2 == 1100 0010
——————————-
0x42 == 0100 0010

How well did you know this?
1
Not at all
2
3
4
5
Perfectly