?
What is the result of `6 | 3` ?
Answer & Solution
Correct Answer:
Option
D
The bitwise OR operator (
|) performs a bitwise OR operation on each corresponding bit of the two numbers. In this case, the binary representation of 6 is 110, and the binary representation of 3 is 011. When performing a bitwise OR, if any of the corresponding bits is 1, the result bit will be 1; otherwise, it will be 0. So, performing 6 | 3 results in 111, which is 7 in decimal notation. Therefore, the correct answer is Option D.
Join the Discussion
Login to post a comment or share your explanation.
Login