Machine-translated by Google. Questions are authored in English.
Top

Discussion

Bitwise & and | are unary operators

  • A.True
  • B.False

Answer: B

Correct answer: False

Both are binary operators: each takes two operands and combines them bit by bit, as in a & b and a | b.

C's only unary bitwise operator is ~, the one's complement, which inverts every bit of a single operand. The confusion usually comes from & also serving as the unary address-of operator in a quite different context - &x against a & b - but that is a distinct operator sharing the same symbol, not the bitwise AND used with one operand.

No comment is present. Be the first to comment.
Loading…

Post your comment

Please log in or register to post a comment.