πŸ“Š C++
Q. What is the output of the following code snippet? int x = 10; int y = 20; cout << (x <<= 1);
  • (A) 10
  • (B) 20
  • (C) 40
  • (D) Error
πŸ’¬ Discuss
βœ… Correct Answer: (B) 20

Explanation: The compound assignment operator (<<=) shifts the bits of x to the left by 1, effectively multiplying x by 2. So, x becomes 20.

Explanation by: Gopal Sharma
The compound assignment operator (<<=) shifts the bits of x to the left by 1, effectively multiplying x by 2. So, x becomes 20.

πŸ’¬ Discussion


πŸ“Š Question Analytics

πŸ‘οΈ
92
Total Visits
πŸ“½οΈ
1 y ago
Published
πŸŽ–οΈ
Gopal Sharma
Publisher
πŸ“ˆ
89%
Success Rate