31
GB
What is the output: int x = -5; cout << (x >> 1);
IN
आउटपुट क्या है: int x = -5; कॉउट > 1);
A
-3
-3
B
-2
-2
C
-1
-1
D
Undefined
अपरिभाषित
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English)
Right-shifting a negative signed integer is implementation-defined. On most platforms (arithmetic shift): -5>>1 = -3 (rounds toward negative infinity).
व्याख्या (हिन्दी)
एक नकारात्मक हस्ताक्षरित पूर्णांक को राइट-शिफ्टिंग कार्यान्वयन-परिभाषित है। अधिकांश प्लेटफ़ॉर्म पर (अंकगणितीय बदलाव): -5>>1 = -3 (नकारात्मक अनंत की ओर राउंड)।