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

  • (A) 5
  • (B) 10
  • (C) 20
  • (D) Error
πŸ’¬ Discuss
βœ… Correct Answer: (A) 5
Explanation: The right shift operator (>>) shifts the bits of x to the right by 1, effectively dividing x by 2. So, 10 >> 1 = 5.
Explanation by: Priyanka Tomar
The right shift operator (>>) shifts the bits of x to the right by 1, effectively dividing x by 2. So, 10 >> 1 = 5.

πŸ’¬ Discussion


πŸ“Š Question Analytics

πŸ‘οΈ
119
Total Visits
πŸ“½οΈ
2 y ago
Published
πŸŽ–οΈ
Priyanka Tomar
Publisher
πŸ“ˆ
89%
Success Rate