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
πŸ’¬ Discuss
βœ… Correct Answer: (C) 30
Explanation: The compound assignment operator (+=) adds y to x and returns the new value of x, which is 30.
Explanation by: Vinay
The compound assignment operator (+=) adds y to x and returns the new value of x, which is 30.

πŸ’¬ Discussion


πŸ“Š Question Analytics

πŸ‘οΈ
130
Total Visits
πŸ“½οΈ
2 y ago
Published
πŸŽ–οΈ
Vinay
Publisher
πŸ“ˆ
86%
Success Rate