31
GB
What is the output: int x = -1; unsigned int y = x; cout << (y > 0);
IN
आउटपुट क्या है: int x = -1; अहस्ताक्षरित int y = x; कोउट 0);
B
1
1
C
Undefined
अपरिभाषित
D
Compile error
संकलन त्रुटि
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English)
-1 converted to unsigned int becomes UINT_MAX (a large positive number), so y > 0 is true, output is 1.
व्याख्या (हिन्दी)
-1 को अहस्ताक्षरित int में परिवर्तित करने पर UINT_MAX (एक बड़ी धनात्मक संख्या) बन जाती है, इसलिए y > 0 सत्य है, आउटपुट 1 है।