1681
GB
What is the output: class A{public:int x; A(int v):x(v){} A(const A& o):x(o.x){} A& operator=(A o){swap(x,o.x);return *this;}}; A a(3),b(5); a=b; cout<
IN
आउटपुट क्या है: class A{public:int x; A(int v):x(v){} A(const A& o):x(o.x){} A& ऑपरेटर=(A o){swap(x,o.x);return *this;}}; ए ए(3),बी(5); ए=बी; अदालत
A
53
53
B
55
55
C
Compile error
संकलन त्रुटि
D
Undefined
अपरिभाषित
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English)
a=b: copy b to o(x=5), swap a.x and o.x: a.x=5,o.x=3. Output: 53.
व्याख्या (हिन्दी)
a=b: b को o(x=5) पर कॉपी करें, a.x और o.x को स्वैप करें: a.x=5,o.x=3. आउटपुट: 53.