16
GB
What is the output: class A{public: A(){x=++c;} static int c; int x;}; int A::c=0; A a,b,c; cout<
IN
आउटपुट क्या है: class A{public: A(){x=++c;} static int c; int x;}; int A::c=0; ए ए, बी, सी; अदालत
A
123
123
B
321
321
C
111
111
D
Compile error
संकलन त्रुटि
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English)
Each constructor increments static c: a.x=1, b.x=2, c.x=3. Output: 123.
व्याख्या (हिन्दी)
प्रत्येक कंस्ट्रक्टर स्थिर c बढ़ाता है: a.x=1, b.x=2, c.x=3। आउटपुट: 123.