31 Question 31 EN + हिं GB What is the output: class A{public:void f(){cout<<'A';}}; class B:public A{public:void f(){cout<<'B';}}; B b; b.f(); b.A::f(); IN आउटपुट क्या है: कक्षा ए {सार्वजनिक: शून्य एफ() {काउट A BA बी ० ए B AB अब C Compile error संकलन त्रुटि D Undefined अपरिभाषित ✅ Correct Answer: 💡 Explanation / व्याख्या Explanation (English) b.f()=B, b.A::f()=A. Output: BA. व्याख्या (हिन्दी) b.f()=B, b.A::f()=A. आउटपुट: बी.ए. 🎯 Exam Perspective OOP Using C++ ("Inheritance" sub-topic) से जुड़ा यह सवाल उन students के लिए काम का है जो Railway, SSC, Banking और Defence परीक्षाओं की तैयारी कर रहे हैं। बेहतर होगा कि explanation पढ़कर concept clear करें, ताकि exam में similar प्रश्न आने पर confusion न हो। 🔗 Related Questions What is the output: class A{public:int x=1;}; class B:p... What is the output: class A{public:virtual void f(){cou... What is the output: class A{public:static void f(){cout 📚 Related Topic Introduction to C++ (187) Variables and Data Types (160) Operators in C++ (163)
32 Question 32 EN + हिं GB What is the output: class A{public:int x=1;}; class B:public A{public:int y=2;}; B b; cout< IN आउटपुट क्या है: class A{public:int x=1;}; कक्षा बी:सार्वजनिक ए{सार्वजनिक:int y=2;}; बी बी; अदालत A 12 12 B 21 21 C Compile error संकलन त्रुटि D Undefined अपरिभाषित ✅ Correct Answer: 💡 Explanation / व्याख्या Explanation (English) b.x=1 (from A), b.y=2. Output: 12. व्याख्या (हिन्दी) b.x=1 (ए से), b.y=2. आउटपुट: 12. 🎯 Exam Perspective SSC, Railway, Banking और State PCS जैसी परीक्षाओं में OOP Using C++ ("Inheritance" sub-topic) से सवाल अक्सर पूछे जाते हैं। इसलिए सिर्फ answer रटने के बजाय, नीचे दी गई explanation को ध्यान से पढ़ें और concept समझें। 🔗 Related Questions What is the output: class A{public:virtual void f(){cou... What is the output: class A{public:void f(){cout What is 'covariant return type' example? 📚 Related Topic Introduction to C++ (187) Variables and Data Types (160) Operators in C++ (163)
33 Question 33 EN + हिं GB What is the output: class A{public:virtual void f(){cout<<'A';} virtual ~A(){}}; class B:public A{public:void f()override{cout<<'B';}}; unique_ptr p=make_unique(); p->f(); IN आउटपुट क्या है: क्लास ए {पब्लिक: वर्चुअल शून्य एफ() {काउट A B बी B A ए C Compile error संकलन त्रुटि D Undefined अपरिभाषित ✅ Correct Answer: 💡 Explanation / व्याख्या Explanation (English) p->f() virtual: B::f(). Output: B. व्याख्या (हिन्दी) p->f() वर्चुअल: B::f(). आउटपुट: बी. 🎯 Exam Perspective अगर आप SSC CGL, IBPS, RRB और State-level परीक्षाओं की तैयारी कर रहे हैं, तो OOP Using C++ ("Inheritance" sub-topic) का यह topic आपके लिए महत्वपूर्ण है। Exam में accuracy बढ़ाने के लिए हर सवाल की explanation जरूर पढ़ें। 🔗 Related Questions What is the output: class A{public:static void f(){cout What is the output: class A{public:virtual void f()=0;... What is the output: class A{public:virtual int f(){retu... 📚 Related Topic Introduction to C++ (187) Variables and Data Types (160) Operators in C++ (163)
34 Question 34 EN + हिं GB What is the output: class A{protected:int x=10;}; class B:public A{public:void show(){cout< IN आउटपुट क्या है: class A{protected:int x=10;}; कक्षा बी: सार्वजनिक ए {सार्वजनिक: शून्य शो() {काउट A 10 10 C Compile error संकलन त्रुटि D Undefined अपरिभाषित ✅ Correct Answer: 💡 Explanation / व्याख्या Explanation (English) x=10 accessible in B. Output: 10. व्याख्या (हिन्दी) x=10 बी में पहुंच योग्य। आउटपुट: 10। 🎯 Exam Perspective OOP Using C++ ("Inheritance" sub-topic) के इस प्रश्न को कई प्रतियोगी परीक्षाओं जैसे UPSC, SSC, Banking और Police भर्ती में repeat होते देखा गया है। Concept clarity के लिए explanation section जरूर पढ़ें। 🔗 Related Questions What is the output: class A{public:virtual int f(){retu... What is the output: class A{public:A(int){cout What is the output: struct A{int x=1;}; struct B:A{int... 📚 Related Topic Introduction to C++ (187) Variables and Data Types (160) Operators in C++ (163)
35 Question 35 EN + हिं GB What is the output: class A{public:A(int){cout<<'A';}}; class B:public A{public:B():A(5){cout<<'B';}}; B b; IN आउटपुट क्या है: क्लास ए {पब्लिक: ए (इंट) {काउट A AB अब B BA बी ० ए C Compile error संकलन त्रुटि D Undefined अपरिभाषित ✅ Correct Answer: 💡 Explanation / व्याख्या Explanation (English) A(5) first=A, then B=B. Output: AB. व्याख्या (हिन्दी) ए(5) पहले=ए, फिर बी=बी। आउटपुट: एबी. 🎯 Exam Perspective यह सवाल OOP Using C++ ("Inheritance" sub-topic) category का है, और Railway, SSC, Banking और Defence परीक्षाओं के exam pattern में इस तरह के questions common हैं। Answer choose करने के बाद दिया गया explanation जरूर पढ़ें। 🔗 Related Questions What is the output: class A{public:static void f(){cout What is the output: class A{protected:int x=10;}; class... What is the output: class A{public:virtual void f(){cou... 📚 Related Topic Introduction to C++ (187) Variables and Data Types (160) Operators in C++ (163)
36 Question 36 EN + हिं GB What is 'virtual inheritance' use case? IN 'वर्चुअल इनहेरिटेंस' उपयोग मामला क्या है? A Diamond: ensure single base subobject हीरा: एकल आधार उपवस्तु सुनिश्चित करें B Performance optimization प्रदर्शन अनुकूलन C Multiple return types एकाधिक रिटर्न प्रकार D Template specialization टेम्पलेट विशेषज्ञता ✅ Correct Answer: 💡 Explanation / व्याख्या Explanation (English) class B:virtual public A{}; class C:virtual public A{}; class D:public B,C{}; D has one A. व्याख्या (हिन्दी) कक्षा बी:वर्चुअल पब्लिक ए{}; क्लास सी:वर्चुअल पब्लिक ए{}; कक्षा डी:सार्वजनिक बी,सी{}; D के पास एक A है. 🎯 Exam Perspective यह प्रश्न OOP Using C++ ("Inheritance" sub-topic) की तैयारी करने वाले अभ्यर्थियों के लिए उपयोगी है। इस तरह के प्रश्न अक्सर SSC, Railway, Banking और State PCS जैसी परीक्षाओं में पूछे जाते रहे हैं, इसलिए concept और explanation दोनों को ध्यान से समझें, सिर्फ उत्तर याद न करें। 🔗 Related Questions What is the output: class A{public:virtual void f(){cou... What is the output: struct A{int x=1;}; struct B:A{int... What is the output: class A{public:int x=1;}; class B:p... 📚 Related Topic Introduction to C++ (187) Variables and Data Types (160) Operators in C++ (163)
37 Question 37 EN + हिं GB What is the output: class A{public:virtual int f(){return 1;}}; class B:public A{public:int f()override{return 2;}}; class C:public B{public:int f()override{return 3;}}; A*p=new C; cout<f(); IN आउटपुट क्या है: क्लास ए{पब्लिक:वर्चुअल इंट एफ(){रिटर्न 1;}}; कक्षा बी:सार्वजनिक ए{सार्वजनिक:int f()ओवरराइड{वापसी 2;}}; कक्षा सी:सार्वजनिक बी{सार्वजनिक:int f()ओवरराइड{वापसी 3;}}; ए*पी=नया सी; अदालत A 3 3 B 1 1 C Compile error संकलन त्रुटि D Undefined अपरिभाषित ✅ Correct Answer: 💡 Explanation / व्याख्या Explanation (English) C::f() is most derived. Output: 3. व्याख्या (हिन्दी) C::f() सबसे अधिक व्युत्पन्न है। आउटपुट: 3. 🎯 Exam Perspective OOP Using C++ ("Inheritance" sub-topic) से जुड़ा यह सवाल उन students के लिए काम का है जो SSC CGL, IBPS, RRB और State-level परीक्षाओं की तैयारी कर रहे हैं। बेहतर होगा कि explanation पढ़कर concept clear करें, ताकि exam में similar प्रश्न आने पर confusion न हो। 🔗 Related Questions What is 'covariant return type' example? What is the output: class A{public:void f(){cout What is the output: class A{public:void f(){cout 📚 Related Topic Introduction to C++ (187) Variables and Data Types (160) Operators in C++ (163)
38 Question 38 EN + हिं GB What is the output: class A{public:void f(){cout<<1;}}; class B:public A{public:void f(){cout<<2;} void g(){A::f(); f();}}; B b; b.g(); IN आउटपुट क्या है: कक्षा ए {सार्वजनिक: शून्य एफ() {काउट A 12 12 B 21 21 C Compile error संकलन त्रुटि D Undefined अपरिभाषित ✅ Correct Answer: 💡 Explanation / व्याख्या Explanation (English) A::f()=1; f()=B::f()=2. Output: 12. व्याख्या (हिन्दी) ए::एफ()=1; एफ()=बी::एफ()=2. आउटपुट: 12. 🎯 Exam Perspective UPSC, SSC, Banking और Police भर्ती जैसी परीक्षाओं में OOP Using C++ ("Inheritance" sub-topic) से सवाल अक्सर पूछे जाते हैं। इसलिए सिर्फ answer रटने के बजाय, नीचे दी गई explanation को ध्यान से पढ़ें और concept समझें। 🔗 Related Questions What is 'virtual inheritance' use case? What is the output: class A{public:virtual int f(){retu... What is the output: class A{public:virtual void f(){cou... 📚 Related Topic Introduction to C++ (187) Variables and Data Types (160) Operators in C++ (163)
39 Question 39 EN + हिं GB What is the output: class A{public:int x; A(int v):x(v){}}; class B:public A{public:int y; B(int a,int b):A(a),y(b){}}; B b(3,4); cout< IN आउटपुट क्या है: class A{public:int x; A(int v):x(v){}}; कक्षा बी:सार्वजनिक ए{सार्वजनिक:int y; B(int a,int b):A(a),y(b){}}; बी बी(3,4); अदालत A 34 34 B 43 43 C Compile error संकलन त्रुटि D Undefined अपरिभाषित ✅ Correct Answer: 💡 Explanation / व्याख्या Explanation (English) x=3,y=4. Output: 34. व्याख्या (हिन्दी) x=3,y=4. आउटपुट: 34. 🎯 Exam Perspective अगर आप Railway, SSC, Banking और Defence परीक्षाओं की तैयारी कर रहे हैं, तो OOP Using C++ ("Inheritance" sub-topic) का यह topic आपके लिए महत्वपूर्ण है। Exam में accuracy बढ़ाने के लिए हर सवाल की explanation जरूर पढ़ें। 🔗 Related Questions What is the output: class A{public:static void f(){cout What is the output: class A{public:int x=0; virtual voi... What is the output: class A{public:virtual int f(){retu... 📚 Related Topic Introduction to C++ (187) Variables and Data Types (160) Operators in C++ (163)
40 Question 40 EN + हिं GB What is the output: class A{public:static void f(){cout<<'S';}}; class B:public A{}; B::f(); IN आउटपुट क्या है: वर्ग ए {सार्वजनिक: स्थिर शून्य एफ() {काउट A S एस B Compile error संकलन त्रुटि C Undefined अपरिभाषित D Nothing कुछ नहीं ✅ Correct Answer: 💡 Explanation / व्याख्या Explanation (English) B inherits A::f. B::f()=S. Output: S. व्याख्या (हिन्दी) B को A::f विरासत में मिला है। बी::एफ()=एस। आउटपुट: एस. 🎯 Exam Perspective OOP Using C++ ("Inheritance" sub-topic) के इस प्रश्न को कई प्रतियोगी परीक्षाओं जैसे SSC, Railway, Banking और State PCS में repeat होते देखा गया है। Concept clarity के लिए explanation section जरूर पढ़ें। 🔗 Related Questions What is the output: class A{protected:int x=10;}; class... What is the output: class A{public:virtual void f()=0;... What is 'virtual inheritance' use case? 📚 Related Topic Introduction to C++ (187) Variables and Data Types (160) Operators in C++ (163)
41 Question 41 EN + हिं GB What is the output: class A{public:virtual void f(){cout<<'A';}}; class B:public A{public:void f()final{cout<<'B';}}; B b; b.f(); IN आउटपुट क्या है: क्लास ए {पब्लिक: वर्चुअल शून्य एफ() {काउट A B बी B A ए C Compile error संकलन त्रुटि D Undefined अपरिभाषित ✅ Correct Answer: 💡 Explanation / व्याख्या Explanation (English) b.f() calls B::f()=B. Output: B. व्याख्या (हिन्दी) b.f() कॉल B::f()=B. आउटपुट: बी. 🎯 Exam Perspective यह सवाल OOP Using C++ ("Inheritance" sub-topic) category का है, और SSC CGL, IBPS, RRB और State-level परीक्षाओं के exam pattern में इस तरह के questions common हैं। Answer choose करने के बाद दिया गया explanation जरूर पढ़ें। 🔗 Related Questions What is the output: class A{public:int x=1;}; class B:p... What is the output: class A{public:void f(){cout What is the output: class A{public:int x=0; virtual voi... 📚 Related Topic Introduction to C++ (187) Variables and Data Types (160) Operators in C++ (163)
42 Question 42 EN + हिं GB What is 'covariant return type' example? IN 'सहसंयोजक रिटर्न प्रकार' उदाहरण क्या है? A Base:virtual A* f(); Derived:B* f() where B derives A आधार:वर्चुअल ए* एफ(); व्युत्पन्न:B* f() जहां B से A प्राप्त होता है B Same return type always हमेशा एक ही रिटर्न प्रकार C Template return टेम्पलेट वापसी D void return only केवल शून्य वापसी ✅ Correct Answer: 💡 Explanation / व्याख्या Explanation (English) Overriding may return derived pointer/reference of base's return type. व्याख्या (हिन्दी) ओवरराइडिंग से आधार के रिटर्न प्रकार का व्युत्पन्न सूचक/संदर्भ वापस आ सकता है। 🎯 Exam Perspective यह प्रश्न OOP Using C++ ("Inheritance" sub-topic) की तैयारी करने वाले अभ्यर्थियों के लिए उपयोगी है। इस तरह के प्रश्न अक्सर UPSC, SSC, Banking और Police भर्ती जैसी परीक्षाओं में पूछे जाते रहे हैं, इसलिए concept और explanation दोनों को ध्यान से समझें, सिर्फ उत्तर याद न करें। 🔗 Related Questions What is the output: class A{public:static void f(){cout What is the output: class A{public:virtual void f(){cou... What is the output: class A{public:int x=1;}; class B:p... 📚 Related Topic Introduction to C++ (187) Variables and Data Types (160) Operators in C++ (163)
43 Question 43 EN + हिं GB What is the output: struct A{int x=1;}; struct B:A{int y=2;}; struct C:B{int z=3;}; C c; cout< IN आउटपुट क्या है: struct A{int x=1;}; संरचना बी:ए{int y=2;}; संरचना C:B{int z=3;}; सी सी; अदालत A 123 123 B 321 321 C Compile error संकलन त्रुटि D Undefined अपरिभाषित ✅ Correct Answer: 💡 Explanation / व्याख्या Explanation (English) All inherited. x=1,y=2,z=3. Output: 123. व्याख्या (हिन्दी) सब विरासत में मिला. x=1,y=2,z=3. आउटपुट: 123. 🎯 Exam Perspective OOP Using C++ ("Inheritance" sub-topic) से जुड़ा यह सवाल उन students के लिए काम का है जो Railway, SSC, Banking और Defence परीक्षाओं की तैयारी कर रहे हैं। बेहतर होगा कि explanation पढ़कर concept clear करें, ताकि exam में similar प्रश्न आने पर confusion न हो। 🔗 Related Questions What is the output: class A{public:int x=0; virtual voi... What is the output: class A{public:int x; A(int v):x(v)... What is 'covariant return type' example? 📚 Related Topic Introduction to C++ (187) Variables and Data Types (160) Operators in C++ (163)
44 Question 44 EN + हिं GB What is the output: class A{public:virtual void f()=0; void g(){f();}}; class B:public A{public:void f(){cout<<'B';}}; B b; b.g(); IN आउटपुट क्या है: class A{public:virtual void f()=0; शून्य g(){f();}}; कक्षा बी: सार्वजनिक ए {सार्वजनिक: शून्य एफ() {काउट A B बी B A ए C Compile error संकलन त्रुटि D Undefined अपरिभाषित ✅ Correct Answer: 💡 Explanation / व्याख्या Explanation (English) g() calls virtual f(); dispatches to B::f(). Output: B. व्याख्या (हिन्दी) g() वर्चुअल f() को कॉल करता है; B::f() को भेजता है। आउटपुट: बी. 🎯 Exam Perspective SSC, Railway, Banking और State PCS जैसी परीक्षाओं में OOP Using C++ ("Inheritance" sub-topic) से सवाल अक्सर पूछे जाते हैं। इसलिए सिर्फ answer रटने के बजाय, नीचे दी गई explanation को ध्यान से पढ़ें और concept समझें। 🔗 Related Questions What is the output: class A{public:virtual void f(){cou... What is the output: class A{public:A(int){cout What is the output: class A{public:void f(){cout 📚 Related Topic Introduction to C++ (187) Variables and Data Types (160) Operators in C++ (163)
45 Question 45 EN + हिं GB What is the output: class A{public:int x=0; virtual void f(){x=1;}}; class B:public A{public:void f()override{x=2;}}; A *p=new B; p->f(); cout<x; IN आउटपुट क्या है: class A{public:int x=0; आभासी शून्य f(){x=1;}}; कक्षा बी:सार्वजनिक ए{सार्वजनिक:शून्य f()ओवरराइड{x=2;}}; ए *पी=नया बी; p->f(); अदालत A 2 2 B 1 1 C Compile error संकलन त्रुटि D Undefined अपरिभाषित ✅ Correct Answer: 💡 Explanation / व्याख्या Explanation (English) p->f() dispatches to B::f(); x=2. Output: 2. व्याख्या (हिन्दी) p->f() B::f() को भेजता है; एक्स=2. आउटपुट: 2. 🎯 Exam Perspective अगर आप SSC CGL, IBPS, RRB और State-level परीक्षाओं की तैयारी कर रहे हैं, तो OOP Using C++ ("Inheritance" sub-topic) का यह topic आपके लिए महत्वपूर्ण है। Exam में accuracy बढ़ाने के लिए हर सवाल की explanation जरूर पढ़ें। 🔗 Related Questions What is the output: class A{public:int x=1;}; class B:p... What is the output: class A{public:void f(){cout What is the output: class A{protected:int x=10;}; class... 📚 Related Topic Introduction to C++ (187) Variables and Data Types (160) Operators in C++ (163)