R

Rakesh Kumar • 28.44K 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) 0
  • (D) Error
  • Correct Answer - Option(B)
  • Views: 47
  • Filed under category C++

Explanation by: Rakesh Kumar
The assignment operator (=) assigns the value of y to x and returns the value of y, which is 20.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.


Question analytics