?
Which operator is used to perform a bitwise OR operation in C?
Answer & Solution
Correct Answer:
Option
B
In C, the | operator is used to perform a bitwise OR operation. It performs a bitwise OR between corresponding bits of two integers. It returns a new integer where each bit is the result of ORing the corresponding bits of the operands.
Option A (&&) represents the logical AND operator, which is used for logical comparisons, not bitwise operations.
Option C (&) represents the bitwise AND operator, which performs bitwise AND operations, not bitwise OR.
Option D (||) represents the logical OR operator, used for logical comparisons, not bitwise operations.
Option A (&&) represents the logical AND operator, which is used for logical comparisons, not bitwise operations.
Option C (&) represents the bitwise AND operator, which performs bitwise AND operations, not bitwise OR.
Option D (||) represents the logical OR operator, used for logical comparisons, not bitwise operations.
Join the Discussion
Login to post a comment or share your explanation.
Login