V

Vinay • 28.75K Points
Instructor II

Q. What is the output of the following code snippet? int x = 10; int y = 20; cout << (x ^ y);

  • (A) 10
  • (B) 20
  • (C) 30
  • (D) Error
  • Correct Answer - Option(C)
  • Views: 36
  • Filed under category C++

Explanation by: Vinay
The bitwise XOR operation between 10 (1010) and 20 (10100) results in 30.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.


Question analytics