A

Admin • 833K Points
Coach

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

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

Explanation by: Admin

The compound assignment operator (&=) performs a bitwise AND operation between x and y and returns the new value of x, which is 0.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.