Single Choice Not Set

QWhich of the following Bitwise operators can be used efficiently to swap two numbers?

ID: #1368 Operators and Enums in C Language 5,030 views
Question Info
#1368Q ID
Not SetDifficulty
Operators and Enums in C LanguageTopic

Choose the Best Option

Click any option to instantly check if you're correct.

  • A &
  • B ^
  • C |
  • D ||
Correct Answer

Explanation

Solution:b ^

a=a^b
b=a^b
a=a^b

Now 'a' will have 'b' s initial value and wise-versa. 

Share This Question

Challenge a friend or share with your study group.