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