76 Question 76 EN + हिं GB What is the output: class A{public:virtual void f(){cout<<1;}}; class B:public A{public:void f()override{cout<<2;}}; class C:public B{};A*p=new C;p->f(); IN आउटपुट क्या है: क्लास ए {पब्लिक: वर्चुअल शून्य एफ() {काउट A 2 2 B 1 1 C Compile error संकलन त्रुटि D Undefined अपरिभाषित ✅ Correct Answer: 💡 Explanation / व्याख्या Explanation (English) C inherits B::f(). p->f()=2. Output: 2. व्याख्या (हिन्दी) C को B::f() विरासत में मिला है। p->f()=2. आउटपुट: 2. 🎯 Exam Perspective OOP Using C++ ("Inheritance" sub-topic) के इस प्रश्न को कई प्रतियोगी परीक्षाओं जैसे Railway, SSC, Banking और Defence परीक्षाओं में repeat होते देखा गया है। Concept clarity के लिए explanation section जरूर पढ़ें। 🔗 Related Questions What is the output: class A{public:void f(){cout What is the output: class A{public:virtual void f()=0;... What is the output: class A{public:int x=1; virtual int... 📚 Related Topic Introduction to C++ (187) Variables and Data Types (160) Operators in C++ (163)
77 Question 77 EN + हिं GB What is the output: class A{public:int x=10; virtual int f(){return x;}}; class B:public A{public:B(){x=20;} int f()override{return x*2;}}; A*p=new B; cout<f(); IN आउटपुट क्या है: class A{public:int x=10; वर्चुअल int f(){रिटर्न x;}}; क्लास बी:पब्लिक ए{पब्लिक:बी(){x=20;} int f()ओवरराइड{रिटर्न x*2;}}; ए*पी=नया बी; अदालत A 40 40 B 20 20 C Compile error संकलन त्रुटि D Undefined अपरिभाषित ✅ Correct Answer: 💡 Explanation / व्याख्या Explanation (English) B() sets x=20. B::f()=20*2=40. Output: 40. व्याख्या (हिन्दी) बी() x=20 सेट करता है। बी::एफ()=20*2=40। आउटपुट: 40. 🎯 Exam Perspective यह सवाल OOP Using C++ ("Inheritance" sub-topic) category का है, और SSC, Railway, Banking और State PCS के exam pattern में इस तरह के questions common हैं। Answer choose करने के बाद दिया गया explanation जरूर पढ़ें। 🔗 Related Questions What is the output: class A{public:void f(){cout What is the output: class A{public:int x; A(int v):x(v)... What is the output: class A{public:virtual void f()=0;... 📚 Related Topic Introduction to C++ (187) Variables and Data Types (160) Operators in C++ (163)
78 Question 78 EN + हिं GB What is the output: class A{public:virtual void f()=0; int g(){return 42;}}; class B:public A{public:void f()override{cout< IN आउटपुट क्या है: class A{public:virtual void f()=0; int g(){वापसी 42;}}; कक्षा बी: सार्वजनिक ए {सार्वजनिक: शून्य एफ() ओवरराइड {काउट A 42 42 B Compile error संकलन त्रुटि C Undefined अपरिभाषित ✅ Correct Answer: 💡 Explanation / व्याख्या Explanation (English) B::f() calls A::g()=42. Output: 42. व्याख्या (हिन्दी) B::f() A::g()=42 को कॉल करता है। आउटपुट: 42. 🎯 Exam Perspective यह प्रश्न OOP Using C++ ("Inheritance" sub-topic) की तैयारी करने वाले अभ्यर्थियों के लिए उपयोगी है। इस तरह के प्रश्न अक्सर SSC CGL, IBPS, RRB और State-level परीक्षाओं जैसी परीक्षाओं में पूछे जाते रहे हैं, इसलिए concept और explanation दोनों को ध्यान से समझें, सिर्फ उत्तर याद न करें। 🔗 Related Questions What is the output: class A{public:virtual void f(){cou... What is the output: class A{public:int x; A(int v):x(v)... 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)
79 Question 79 EN + हिं GB What is the output: class A{public:int x=5;}; class B:public A{}; class C:public B{}; C c; cout< IN आउटपुट क्या है: class A{public:int x=5;}; कक्षा बी:सार्वजनिक ए{}; कक्षा सी:सार्वजनिक बी{}; सी सी; अदालत A 5 5 C Compile error संकलन त्रुटि D Undefined अपरिभाषित ✅ Correct Answer: 💡 Explanation / व्याख्या Explanation (English) c.x inherited from A. Output: 5. व्याख्या (हिन्दी) c.x ए से विरासत में मिला है। आउटपुट: 5। 🎯 Exam Perspective OOP Using C++ ("Inheritance" sub-topic) से जुड़ा यह सवाल उन students के लिए काम का है जो UPSC, SSC, Banking और Police भर्ती की तैयारी कर रहे हैं। बेहतर होगा कि explanation पढ़कर concept clear करें, ताकि exam में similar प्रश्न आने पर confusion न हो। 🔗 Related Questions What is the output: class A{public:int x=1; virtual int... What is the output: class A{public:A(int v){cout What is the output: class Shape{public:virtual double a... 📚 Related Topic Introduction to C++ (187) Variables and Data Types (160) Operators in C++ (163)
80 Question 80 EN + हिं GB What is the output: class A{public:A(int v){cout< IN आउटपुट क्या है: क्लास ए {पब्लिक: ए (इंट वी) {काउट A 123 123 B 321 321 C Compile error संकलन त्रुटि D Undefined अपरिभाषित ✅ Correct Answer: 💡 Explanation / व्याख्या Explanation (English) A(1)=1, B=2, C=3. Output: 123. व्याख्या (हिन्दी) ए(1)=1, बी=2, सी=3। आउटपुट: 123. 🎯 Exam Perspective Railway, SSC, Banking और Defence परीक्षाओं जैसी परीक्षाओं में OOP Using C++ ("Inheritance" sub-topic) से सवाल अक्सर पूछे जाते हैं। इसलिए सिर्फ answer रटने के बजाय, नीचे दी गई explanation को ध्यान से पढ़ें और concept समझें। 🔗 Related Questions 'What is the output: class A{public:static int n; A(){n... What is the output: class A{public:int x=10; virtual in... What is the output: class Shape{public:virtual double a... 📚 Related Topic Introduction to C++ (187) Variables and Data Types (160) Operators in C++ (163)
81 Question 81 EN + हिं GB What is the output: class A{public:virtual void f(){cout<<'A';} virtual void g(){f();}}; class B:public A{public:void f()override{cout<<'B';}}; B b; b.g(); IN आउटपुट क्या है: क्लास ए {पब्लिक: वर्चुअल शून्य एफ() {काउट A B बी B A ए C Compile error संकलन त्रुटि D Undefined अपरिभाषित ✅ Correct Answer: 💡 Explanation / व्याख्या Explanation (English) g() calls virtual f(): B::f()=B. Output: B. व्याख्या (हिन्दी) g() वर्चुअल f() को कॉल करता है: B::f()=B। आउटपुट: बी. 🎯 Exam Perspective अगर आप SSC, Railway, Banking और State PCS की तैयारी कर रहे हैं, तो OOP Using C++ ("Inheritance" sub-topic) का यह topic आपके लिए महत्वपूर्ण है। Exam में accuracy बढ़ाने के लिए हर सवाल की explanation जरूर पढ़ें। 🔗 Related Questions What is the output: class Shape{public:virtual double a... What is the output: class A{public:virtual int f()const... What is the output: class A{public:int x=10; virtual in... 📚 Related Topic Introduction to C++ (187) Variables and Data Types (160) Operators in C++ (163)
82 Question 82 EN + हिं GB What is the output: class A{public:int x=1; virtual int f(){return x;}}; class B:public A{public:int f()override{return x+1;}}; class C:public B{public:int f()override{return x+2;}}; A a; B b; C c; cout< IN आउटपुट क्या है: class A{public:int x=1; वर्चुअल int f(){रिटर्न x;}}; कक्षा बी:सार्वजनिक ए{सार्वजनिक:int f()ओवरराइड{वापसी x+1;}}; कक्षा सी:सार्वजनिक बी{सार्वजनिक:int f()ओवरराइड{वापसी x+2;}}; ए ए; बी बी; सी सी; अदालत A 123 123 B 111 111 C Compile error संकलन त्रुटि D Undefined अपरिभाषित ✅ Correct Answer: 💡 Explanation / व्याख्या Explanation (English) A::f()=1, B::f()=2, C::f()=3. Output: 123. व्याख्या (हिन्दी) ए::एफ()=1, बी::एफ()=2, सी::एफ()=3। आउटपुट: 123. 🎯 Exam Perspective OOP Using C++ ("Inheritance" sub-topic) के इस प्रश्न को कई प्रतियोगी परीक्षाओं जैसे SSC CGL, IBPS, RRB और State-level परीक्षाओं में repeat होते देखा गया है। Concept clarity के लिए explanation section जरूर पढ़ें। 🔗 Related Questions 'What is the output: class A{public:static int n; A(){n... What is the output: class A{public:int x=0; virtual voi... What is the output: class A{public:A(int v){cout 📚 Related Topic Introduction to C++ (187) Variables and Data Types (160) Operators in C++ (163)
83 Question 83 EN + हिं GB 'What is the output: class A{public:static int n; A(){n++;} ~A(){n (1, 6, 80, 10, 4, 'What is the output: class A{public:int x; A(int v):x(v){}}; class B:virtual public A{public:B():A(1){}}; class C:virtual public A{public:C():A(2){}}; class D:public B IN 'आउटपुट क्या है: क्लास ए{पब्लिक:स्टैटिक इंट एन; A(){n++;} ~A(){n (1, 6, 80, 10, 4, 'आउटपुट क्या है: क्लास ए{पब्लिक:इंट एक्स; ए(इंट वी):एक्स(वी){}}; क्लास बी:वर्चुअल पब्लिक ए{पब्लिक:बी():ए(1){}}; क्लास सी:वर्चुअल पब्लिक ए{पब्लिक:सी():ए(2){}}; क्लास डी:पब्लिक बी A B() बी() B 3 3 C 1 1 D Compile error संकलन त्रुटि ✅ Correct Answer: 🎯 Exam Perspective यह सवाल OOP Using C++ ("Inheritance" sub-topic) category का है, और UPSC, SSC, Banking और Police भर्ती के exam pattern में इस तरह के questions common हैं। Answer choose करने के बाद दिया गया explanation जरूर पढ़ें। 🔗 Related Questions What is the output: class A{public:int x=0; virtual voi... What is the output: class A{public:virtual void f(){cou... 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)
84 Question 84 EN + हिं GB What is the output: class A{public:int x; A(int v):x(v){}}; class B:virtual public A{public:B():A(1){}}; class C:virtual public A{public:C():A(2){}}; class D:public B,public C{public:D():A(3),B(),C(){}}; D d; cout< IN आउटपुट क्या है: class A{public:int x; A(int v):x(v){}}; क्लास बी:वर्चुअल पब्लिक ए{पब्लिक:बी():ए(1){}}; क्लास सी:वर्चुअल पब्लिक ए{पब्लिक:सी():ए(2){}}; कक्षा डी:सार्वजनिक बी,सार्वजनिक सी{सार्वजनिक:डी():ए(3),बी(),सी(){}}; डी डी; अदालत A 3 3 B 1 1 C Compile error संकलन त्रुटि D Undefined अपरिभाषित ✅ Correct Answer: 💡 Explanation / व्याख्या Explanation (English) Most derived class D initializes virtual base A(3). x=3. Output: 3. व्याख्या (हिन्दी) अधिकांश व्युत्पन्न वर्ग डी आभासी आधार ए(3) को आरंभ करता है। एक्स=3. आउटपुट: 3. 🎯 Exam Perspective यह प्रश्न OOP Using C++ ("Inheritance" sub-topic) की तैयारी करने वाले अभ्यर्थियों के लिए उपयोगी है। इस तरह के प्रश्न अक्सर Railway, SSC, Banking और Defence परीक्षाओं जैसी परीक्षाओं में पूछे जाते रहे हैं, इसलिए concept और explanation दोनों को ध्यान से समझें, सिर्फ उत्तर याद न करें। 🔗 Related Questions What is the output: class A{public:virtual void f(){cou... What is the output: class A{public:int x=5;}; class B:p... What is the output: class A{public:virtual int f()const... 📚 Related Topic Introduction to C++ (187) Variables and Data Types (160) Operators in C++ (163)
85 Question 85 EN + हिं GB What is the output: class A{public:void f(){cout<<'A';}}; class B:private A{public:using A::f;}; B b; b.f(); IN आउटपुट क्या है: कक्षा ए {सार्वजनिक: शून्य एफ() {काउट A A ए B Compile error संकलन त्रुटि C Undefined अपरिभाषित D B बी ✅ Correct Answer: 💡 Explanation / व्याख्या Explanation (English) using A::f makes f public in B. b.f()=A::f()=A. Output: A. व्याख्या (हिन्दी) A::f का उपयोग करने से B में f सार्वजनिक हो जाता है। b.f()=A::f()=A। आउटपुट: ए. 🎯 Exam Perspective OOP Using C++ ("Inheritance" sub-topic) से जुड़ा यह सवाल उन students के लिए काम का है जो SSC, Railway, Banking और State PCS की तैयारी कर रहे हैं। बेहतर होगा कि explanation पढ़कर concept clear करें, ताकि exam में similar प्रश्न आने पर confusion न हो। 🔗 Related Questions 'What is the output: class A{public:static int n; A(){n... What is the output: class A{public:int x=10; virtual in... What is the output: class A{public:virtual int f()const... 📚 Related Topic Introduction to C++ (187) Variables and Data Types (160) Operators in C++ (163)
86 Question 86 EN + हिं GB What is the output: class A{public:virtual void f(){cout<<1;} void g(){cout<<2;}}; class B:public A{public:void f()override{cout<<3;} void g(){cout<<4;}}; A *p=new B; p->f(); p->g(); B *q=(B*)p; q->f(); q->g(); IN आउटपुट क्या है: क्लास ए {पब्लिक: वर्चुअल शून्य एफ() {काउट A 3234 3234 B 1234 1234 C Compile error संकलन त्रुटि D Undefined अपरिभाषित ✅ Correct Answer: 💡 Explanation / व्याख्या Explanation (English) p->f()=3(virtual); p->g()=2(non-virtual A); q->f()=3(virtual); q->g()=4(non-virtual B). Output: 3234. व्याख्या (हिन्दी) p->f()=3(आभासी); p->g()=2(गैर-आभासी A); q->f()=3(आभासी); q->g()=4(गैर-आभासी B). आउटपुट: 3234. 🎯 Exam Perspective SSC CGL, IBPS, RRB और State-level परीक्षाओं जैसी परीक्षाओं में OOP Using C++ ("Inheritance" sub-topic) से सवाल अक्सर पूछे जाते हैं। इसलिए सिर्फ answer रटने के बजाय, नीचे दी गई explanation को ध्यान से पढ़ें और concept समझें। 🔗 Related Questions 'What is the output: class A{public:static int n; A(){n... What is the output: class A{public:int x=5;}; class B:p... What is the output: class A{public:A(int v){cout 📚 Related Topic Introduction to C++ (187) Variables and Data Types (160) Operators in C++ (163)
87 Question 87 EN + हिं GB What is the output: class A{public:int x=0; virtual void inc(){x++;}}; class B:public A{public:void inc()override{x+=2;}}; A *p=new B; p->inc(); p->inc(); cout<x; IN आउटपुट क्या है: class A{public:int x=0; आभासी शून्य इंक(){x++;}}; कक्षा बी:सार्वजनिक ए{सार्वजनिक:शून्य इंक()ओवरराइड{x+=2;}}; ए *पी=नया बी; p->inc(); p->inc(); अदालत A 4 4 B 2 2 C Compile error संकलन त्रुटि D Undefined अपरिभाषित ✅ Correct Answer: 💡 Explanation / व्याख्या Explanation (English) Each inc() adds 2. 2+2=4. Output: 4. व्याख्या (हिन्दी) प्रत्येक inc() 2 जोड़ता है। 2+2=4। आउटपुट: 4. 🎯 Exam Perspective अगर आप UPSC, SSC, Banking और Police भर्ती की तैयारी कर रहे हैं, तो OOP Using C++ ("Inheritance" sub-topic) का यह topic आपके लिए महत्वपूर्ण है। Exam में accuracy बढ़ाने के लिए हर सवाल की explanation जरूर पढ़ें। 🔗 Related Questions What is the output: class A{public:int x; A(int v):x(v)... What is the output: class A{public:int x=1; virtual int... 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)
88 Question 88 EN + हिं GB What is the output: class A{public:virtual int f()const{return 1;}}; class B:public A{public:int f()const override{return 2;} int f(){return 3;}}; const A*p=new B; cout<f(); IN आउटपुट क्या है: क्लास ए{पब्लिक:वर्चुअल इंट एफ()कॉन्स्ट{रिटर्न 1;}}; कक्षा बी:सार्वजनिक ए{सार्वजनिक:int f()const ओवरराइड{रिटर्न 2;} int f(){रिटर्न 3;}}; स्थिरांक ए*पी=नया बी; अदालत A 2 2 B 3 3 C Compile error संकलन त्रुटि D Undefined अपरिभाषित ✅ Correct Answer: 💡 Explanation / व्याख्या Explanation (English) p is const A*; virtual const f(); dispatches to B::f()const=2. Output: 2. व्याख्या (हिन्दी) p स्थिरांक A* है; आभासी स्थिरांक f(); B::f()const=2 को भेजता है। आउटपुट: 2. 🎯 Exam Perspective OOP Using C++ ("Inheritance" sub-topic) के इस प्रश्न को कई प्रतियोगी परीक्षाओं जैसे Railway, SSC, Banking और Defence परीक्षाओं में repeat होते देखा गया है। Concept clarity के लिए explanation section जरूर पढ़ें। 🔗 Related Questions What is the output: class A{public:virtual void f(){cou... What is the output: class A{public:int x; A(int v):x(v)... 'What is the output: class A{public:static int n; A(){n... 📚 Related Topic Introduction to C++ (187) Variables and Data Types (160) Operators in C++ (163)
89 Question 89 EN + हिं GB What is the output: class A{public:int x; A(int v):x(v){} A(const A&o)=default;}; class B:public A{public:int y; B(int a,int b):A(a),y(b){}}; B b(3,4); B c=b; cout< IN आउटपुट क्या है: class A{public:int x; A(int v):x(v){} A(const A&o)=default;}; कक्षा बी:सार्वजनिक ए{सार्वजनिक:int y; B(int a,int b):A(a),y(b){}}; बी बी(3,4); बी सी=बी; अदालत A 34 34 B 00 00 C Compile error संकलन त्रुटि D Undefined अपरिभाषित ✅ Correct Answer: 💡 Explanation / व्याख्या Explanation (English) Default copy ctor copies all: c.x=3,c.y=4. Output: 34. व्याख्या (हिन्दी) डिफ़ॉल्ट कॉपी ctor सभी कॉपी करता है: c.x=3,c.y=4. आउटपुट: 34. 🎯 Exam Perspective यह सवाल OOP Using C++ ("Inheritance" sub-topic) category का है, और SSC, Railway, Banking और State PCS के exam pattern में इस तरह के questions common हैं। Answer choose करने के बाद दिया गया explanation जरूर पढ़ें। 🔗 Related Questions What is the output: class A{public:int x=0; virtual voi... What is the output: class A{public:virtual void f(){cou... What is the output: class Shape{public:virtual double a... 📚 Related Topic Introduction to C++ (187) Variables and Data Types (160) Operators in C++ (163)
90 Question 90 EN + हिं GB What is the output: class Shape{public:virtual double area()=0; double perimeter(){return 0;}}; class Sq:public Shape{double s; public:Sq(double v):s(v){} double area()override{return s*s;}}; Sq sq(5); cout< IN आउटपुट क्या है: क्लास शेप{पब्लिक:वर्चुअल डबल एरिया()=0; दोहरा परिधि(){वापसी 0;}}; वर्ग वर्ग:सार्वजनिक आकार{डबल एस; सार्वजनिक: वर्ग (डबल वी): एस (वी) {} डबल एरिया() ओवरराइड {रिटर्न एस * एस;}}; वर्ग वर्ग(5); अदालत A 25 25 B 5 5 C Compile error संकलन त्रुटि D Undefined अपरिभाषित ✅ Correct Answer: 💡 Explanation / व्याख्या Explanation (English) 5*5=25. Output: 25. व्याख्या (हिन्दी) 5*5=25. आउटपुट: 25. 🎯 Exam Perspective यह प्रश्न OOP Using C++ ("Inheritance" sub-topic) की तैयारी करने वाले अभ्यर्थियों के लिए उपयोगी है। इस तरह के प्रश्न अक्सर SSC CGL, IBPS, RRB और State-level परीक्षाओं जैसी परीक्षाओं में पूछे जाते रहे हैं, इसलिए concept और explanation दोनों को ध्यान से समझें, सिर्फ उत्तर याद न करें। 🔗 Related Questions What is the output: class A{public:int x; A(int v):x(v)... What is the output: class A{public:int x=1; virtual int... What is the output: class A{public:int x=10; virtual in... 📚 Related Topic Introduction to C++ (187) Variables and Data Types (160) Operators in C++ (163)