G

Gopal Sharma • 38.32K Points
Coach

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

  • (A) 0
  • (B) 0.5
  • (C) 2
  • (D) Error
  • Correct Answer - Option(A)
  • Views: 27
  • Filed under category C++

Explanation by: Gopal Sharma
The compound assignment operator (/=) divides x by y and returns the new value of x, which is 0 (integer division).

You must be Logged in to update hint/solution

Discusssion

Login to discuss.


Question analytics