46
GB
What is the output: class A{public:int x=1,y=2; A(int v):y(v),x(y){}}; A a(5); cout<
IN
आउटपुट क्या है: class A{public:int x=1,y=2; A(int v):y(v),x(y){}}; ए ए(5); अदालत
A
25
25
B
15
15
C
Compile error
संकलन त्रुटि
D
Undefined
अपरिभाषित
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English)
x initialized first (declaration order): x=y is UB — y not yet initialized. Undefined.
व्याख्या (हिन्दी)
x को पहले प्रारंभ किया गया (घोषणा क्रम): x=y यूबी है - y को अभी तक प्रारंभ नहीं किया गया है। अपरिभाषित.