31
GB
What is the output: class A{public:virtual int f()=0; int g(){return f()*2;}}; class B:public A{public:int f(){return 5;}}; B b; cout<
IN
आउटपुट क्या है: class A{public:virtual int f()=0; int g(){रिटर्न f()*2;}}; कक्षा बी:सार्वजनिक ए{सार्वजनिक:int f(){वापसी 5;}}; बी बी; अदालत
A
10
10
B
5
5
C
Compile error
संकलन त्रुटि
D
Undefined
अपरिभाषित
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English)
B::f()=5; g()=5*2=10. Output: 10.
व्याख्या (हिन्दी)
बी::एफ()=5; जी()=5*2=10. आउटपुट: 10.