31
GB
What is the output: class A{public:int x=0; void f(){x++;}}; A a1,a2; a1.f();a1.f(); a2.f(); cout<
IN
आउटपुट क्या है: class A{public:int x=0; शून्य f(){x++;}}; ए ए1,ए2; a1.f();a1.f(); a2.f(); अदालत
A
21
21
B
12
12
C
Compile error
संकलन त्रुटि
D
Undefined
अपरिभाषित
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English)
a1.x=2, a2.x=1. Output: 21.
व्याख्या (हिन्दी)
a1.x=2, a2.x=1. आउटपुट: 21.