46
GB
What is the output: class A{public:virtual void f()=0;}; class B:public A{public:void f(){cout<<'B';}}; A*arr[2]={new B,new B}; for(auto p:arr) p->f();
IN
आउटपुट क्या है: क्लास ए{पब्लिक:वर्चुअल वॉयड f()=0;}; कक्षा बी: सार्वजनिक ए {सार्वजनिक: शून्य एफ() {काउट
A
BB
बी बी
B
Compile error
संकलन त्रुटि
C
Undefined
अपरिभाषित
D
AA
आ
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English)
Both B::f(). Output: BB.
व्याख्या (हिन्दी)
दोनों B::f(). आउटपुट: बीबी.