πŸ“Š 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 left shift operator (<<) shifts the bits of x to the left by 1, effectively multiplying x by 2. So, 10 << 1 = 20.

Explanation by: Ram Sharma
The left shift operator (<<) shifts the bits of x to the left by 1, effectively multiplying x by 2. So, 10 << 1 = 20.

πŸ’¬ Discussion


πŸ“Š Question Analytics

πŸ‘οΈ
94
Total Visits
πŸ“½οΈ
1 y ago
Published
πŸŽ–οΈ
Ram Sharma
Publisher
πŸ“ˆ
85%
Success Rate