16 Question 16 EN + हिं GB What is the output: class A{public: A(){x=++c;} static int c; int x;}; int A::c=0; A a,b,c; cout< IN आउटपुट क्या है: class A{public: A(){x=++c;} static int c; int x;}; int A::c=0; ए ए, बी, सी; अदालत A 123 123 B 321 321 C 111 111 D Compile error संकलन त्रुटि ✅ Correct Answer: 💡 Explanation / व्याख्या Explanation (English) Each constructor increments static c: a.x=1, b.x=2, c.x=3. Output: 123. व्याख्या (हिन्दी) प्रत्येक कंस्ट्रक्टर स्थिर c बढ़ाता है: a.x=1, b.x=2, c.x=3। आउटपुट: 123. 🎯 Exam Perspective OOP Using C++ ("Constructors and Destructors" sub-topic) के इस प्रश्न को कई प्रतियोगी परीक्षाओं जैसे SSC CGL, IBPS, RRB और State-level परीक्षाओं में repeat होते देखा गया है। Concept clarity के लिए explanation section जरूर पढ़ें। 🔗 Related Questions What happens if constructor throws an exception? What is 'move constructor'? What is the output: class A{int x; public: explicit A(i... 📚 Related Topic Introduction to C++ (187) Variables and Data Types (160) Operators in C++ (163)
17 Question 17 EN + हिं GB What is a 'converting constructor'? IN 'कन्वर्टिंग कंस्ट्रक्टर' क्या है? A Constructor enabling implicit type conversion अंतर्निहित प्रकार के रूपांतरण को सक्षम करने वाला कंस्ट्रक्टर B Constructor for type casting टाइप कास्टिंग के लिए कंस्ट्रक्टर C Explicit constructor स्पष्ट निर्माता D Copy constructor कंस्ट्रक्टर कॉपी करें ✅ Correct Answer: 💡 Explanation / व्याख्या Explanation (English) A constructor callable with a single argument that enables implicit conversion from that argument type to the class type. व्याख्या (हिन्दी) एकल तर्क के साथ कॉल करने योग्य एक कंस्ट्रक्टर जो उस तर्क प्रकार से क्लास प्रकार में अंतर्निहित रूपांतरण को सक्षम बनाता है। 🎯 Exam Perspective यह सवाल OOP Using C++ ("Constructors and Destructors" sub-topic) category का है, और UPSC, SSC, Banking और Police भर्ती के exam pattern में इस तरह के questions common हैं। Answer choose करने के बाद दिया गया explanation जरूर पढ़ें। 🔗 Related Questions What is the output: class A{public: A(int x=10,int y=20... What is the output: class A{public: A(){cout What is the output: class A{public: ~A()=delete;}; {A a... 📚 Related Topic Introduction to C++ (187) Variables and Data Types (160) Operators in C++ (163)
18 Question 18 EN + हिं GB What is the output: class A{public: ~A(){cout<<'X';}}; A *p=new A[3]; delete[] p; IN आउटपुट क्या है: क्लास ए {सार्वजनिक: ~ ए() {काउट A X एक्स B XXX XXX C Undefined अपरिभाषित D Compile error संकलन त्रुटि ✅ Correct Answer: 💡 Explanation / व्याख्या Explanation (English) delete[] calls destructor for each of 3 elements. Output: XXX. व्याख्या (हिन्दी) delete[] प्रत्येक 3 तत्वों के लिए डिस्ट्रक्टर को कॉल करता है। आउटपुट: XXX. 🎯 Exam Perspective यह प्रश्न OOP Using C++ ("Constructors and Destructors" sub-topic) की तैयारी करने वाले अभ्यर्थियों के लिए उपयोगी है। इस तरह के प्रश्न अक्सर Railway, SSC, Banking और Defence परीक्षाओं जैसी परीक्षाओं में पूछे जाते रहे हैं, इसलिए concept और explanation दोनों को ध्यान से समझें, सिर्फ उत्तर याद न करें। 🔗 Related Questions What is 'trivial destructor'? When are destructors called in reverse order? What is the output: class A{public: int x=0; A()=defaul... 📚 Related Topic Introduction to C++ (187) Variables and Data Types (160) Operators in C++ (163)
19 Question 19 EN + हिं GB What happens if constructor throws an exception? IN यदि कंस्ट्रक्टर अपवाद फेंकता है तो क्या होता है? A Object is partially constructed; destructor NOT called वस्तु आंशिक रूप से निर्मित है; विध्वंसक को नहीं बुलाया गया B Destructor is called संहारक कहा जाता है C Program terminates कार्यक्रम समाप्त D Exception is suppressed अपवाद दबा दिया गया है ✅ Correct Answer: 💡 Explanation / व्याख्या Explanation (English) If constructor throws, the object is not fully constructed so its destructor is not called. Already-initialized member destructors are called. व्याख्या (हिन्दी) यदि कंस्ट्रक्टर थ्रो करता है, तो ऑब्जेक्ट पूरी तरह से निर्मित नहीं होता है इसलिए उसके डिस्ट्रक्टर को नहीं बुलाया जाता है। पहले से आरंभ किए गए सदस्य विध्वंसक कहलाते हैं। 🎯 Exam Perspective OOP Using C++ ("Constructors and Destructors" sub-topic) से जुड़ा यह सवाल उन students के लिए काम का है जो SSC, Railway, Banking और State PCS की तैयारी कर रहे हैं। बेहतर होगा कि explanation पढ़कर concept clear करें, ताकि exam में similar प्रश्न आने पर confusion न हो। 🔗 Related Questions What is the output: class A{public: ~A(){cout What is the output: class A{public: A(){cout What is the output: class A{public: A(){cout 📚 Related Topic Introduction to C++ (187) Variables and Data Types (160) Operators in C++ (163)
20 Question 20 EN + हिं GB What is the output: class A{public: A(int x){cout< IN आउटपुट क्या है: क्लास ए {पब्लिक: ए (इंट एक्स) {काउट A 5C 5सी B 5 5 C CC सीसी D Compile error संकलन त्रुटि ✅ Correct Answer: 💡 Explanation / व्याख्या Explanation (English) obj(5): prints 5. f(obj): passes by value, copy constructor called, prints C. Output: 5C. व्याख्या (हिन्दी) obj(5): प्रिंट 5. f(obj): मान से गुजरता है, कॉपी कंस्ट्रक्टर को बुलाया जाता है, C प्रिंट करता है। आउटपुट: 5C। 🎯 Exam Perspective SSC CGL, IBPS, RRB और State-level परीक्षाओं जैसी परीक्षाओं में OOP Using C++ ("Constructors and Destructors" sub-topic) से सवाल अक्सर पूछे जाते हैं। इसलिए सिर्फ answer रटने के बजाय, नीचे दी गई explanation को ध्यान से पढ़ें और concept समझें। 🔗 Related Questions What is the output: class A{public: int x=0; A()=defaul... What is 'Rule of Five' in C++11? What is the output: class A{public: ~A(){cout 📚 Related Topic Introduction to C++ (187) Variables and Data Types (160) Operators in C++ (163)
21 Question 21 EN + हिं GB What is 'move constructor'? IN 'मूव कंस्ट्रक्टर' क्या है? A Constructor transferring resources from rvalue कंस्ट्रक्टर प्रतिद्वंद्विता से संसाधनों को स्थानांतरित कर रहा है B Copy constructor कंस्ट्रक्टर कॉपी करें C Default constructor डिफ़ॉल्ट कंस्ट्रक्टर D Delegating constructor प्रतिनिधि निर्माणकर्ता ✅ Correct Answer: 💡 Explanation / व्याख्या Explanation (English) Move constructor A(A&&) steals resources from a temporary (rvalue) instead of copying them. व्याख्या (हिन्दी) मूव कंस्ट्रक्टर A(A&&) संसाधनों को कॉपी करने के बजाय अस्थायी (प्रतिद्वंद्विता) से चुराता है। 🎯 Exam Perspective अगर आप UPSC, SSC, Banking और Police भर्ती की तैयारी कर रहे हैं, तो OOP Using C++ ("Constructors and Destructors" sub-topic) का यह topic आपके लिए महत्वपूर्ण है। Exam में accuracy बढ़ाने के लिए हर सवाल की explanation जरूर पढ़ें। 🔗 Related Questions What is the output: class A{public: int x=0; A()=defaul... What is a 'converting constructor'? What is the output: class A{public: A(){x=++c;} static... 📚 Related Topic Introduction to C++ (187) Variables and Data Types (160) Operators in C++ (163)
22 Question 22 EN + हिं GB What is the output: class A{public: A(){cout<<'N';} A(int){cout<<'I';} A(double){cout<<'D';}}; A a(1), b(1.0), c; IN आउटपुट क्या है: क्लास ए {पब्लिक: ए() {काउट A IDA आईडीए B IDN आईडीएन C NID एनआईडी D Compile error संकलन त्रुटि ✅ Correct Answer: 💡 Explanation / व्याख्या Explanation (English) a(1): int ctor=I. b(1.0): double ctor=D. c: default ctor=N. Output: IDN. व्याख्या (हिन्दी) a(1): int ctor=I. b(1.0): डबल ctor=D. सी: डिफ़ॉल्ट ctor=N. आउटपुट: आईडीएन. 🎯 Exam Perspective OOP Using C++ ("Constructors and Destructors" sub-topic) के इस प्रश्न को कई प्रतियोगी परीक्षाओं जैसे Railway, SSC, Banking और Defence परीक्षाओं में repeat होते देखा गया है। Concept clarity के लिए explanation section जरूर पढ़ें। 🔗 Related Questions What is 'move constructor'? What happens if constructor throws an exception? When are destructors called in reverse order? 📚 Related Topic Introduction to C++ (187) Variables and Data Types (160) Operators in C++ (163)
23 Question 23 EN + हिं GB What is the output: class A{public: int x=0; A()=default;}; A a{}; cout< IN आउटपुट क्या है: class A{public: int x=0; ए()=डिफ़ॉल्ट;}; ए ए{}; अदालत B Undefined अपरिभाषित C 1 1 D Compile error संकलन त्रुटि ✅ Correct Answer: 💡 Explanation / व्याख्या Explanation (English) Default constructor with in-class initializer: x=0. Output: 0. व्याख्या (हिन्दी) इन-क्लास इनिशियलाइज़र के साथ डिफ़ॉल्ट कंस्ट्रक्टर: x=0। आउटपुट: 0. 🎯 Exam Perspective यह सवाल OOP Using C++ ("Constructors and Destructors" sub-topic) category का है, और SSC, Railway, Banking और State PCS के exam pattern में इस तरह के questions common हैं। Answer choose करने के बाद दिया गया explanation जरूर पढ़ें। 🔗 Related Questions What is the output: class A{public: A(){x=++c;} static... What is the output: class A{public: A(){cout What is 'Rule of Five' in C++11? 📚 Related Topic Introduction to C++ (187) Variables and Data Types (160) Operators in C++ (163)
24 Question 24 EN + हिं GB What is 'Rule of Five' in C++11? IN C++11 में 'पांच का नियम' क्या है? A Define all 5: destructor, copy-ctor, copy-assign, move-ctor, move-assign सभी 5 को परिभाषित करें: डिस्ट्रक्टर, कॉपी-क्टर, कॉपी-असाइन, मूव-क्टर, मूव-असाइन B 5 virtual functions 5 आभासी कार्य C 5 inheritance levels 5 वंशानुक्रम स्तर D 5 constructors 5 कंस्ट्रक्टर ✅ Correct Answer: 💡 Explanation / व्याख्या Explanation (English) Rule of Five extends Rule of Three with move constructor and move assignment operator for C++11. व्याख्या (हिन्दी) पाँच का नियम C++11 के लिए मूव कंस्ट्रक्टर और मूव असाइनमेंट ऑपरेटर के साथ तीन के नियम का विस्तार करता है। 🎯 Exam Perspective यह प्रश्न OOP Using C++ ("Constructors and Destructors" sub-topic) की तैयारी करने वाले अभ्यर्थियों के लिए उपयोगी है। इस तरह के प्रश्न अक्सर SSC CGL, IBPS, RRB और State-level परीक्षाओं जैसी परीक्षाओं में पूछे जाते रहे हैं, इसलिए concept और explanation दोनों को ध्यान से समझें, सिर्फ उत्तर याद न करें। 🔗 Related Questions What is the output: class A{public: ~A()=delete;}; {A a... What is the output: class A{public: ~A(){cout What is 'trivial destructor'? 📚 Related Topic Introduction to C++ (187) Variables and Data Types (160) Operators in C++ (163)
25 Question 25 EN + हिं GB What is the output: class A{public: A(){cout<<'B';} ~A(){cout<<'E';} void f(){cout<<'M';}}; A a; a.f(); IN आउटपुट क्या है: क्लास ए {पब्लिक: ए() {काउट A BME बीएमई B BEM कार्यलय C Compile error संकलन त्रुटि D BE होना ✅ Correct Answer: 💡 Explanation / व्याख्या Explanation (English) Constructor prints B, f() prints M, destructor prints E at end of scope. Output: BME. व्याख्या (हिन्दी) कंस्ट्रक्टर बी प्रिंट करता है, एफ() प्रिंट एम, डिस्ट्रक्टर स्कोप के अंत में ई प्रिंट करता है। आउटपुट: बीएमई. 🎯 Exam Perspective OOP Using C++ ("Constructors and Destructors" sub-topic) से जुड़ा यह सवाल उन students के लिए काम का है जो UPSC, SSC, Banking और Police भर्ती की तैयारी कर रहे हैं। बेहतर होगा कि explanation पढ़कर concept clear करें, ताकि exam में similar प्रश्न आने पर confusion न हो। 🔗 Related Questions When are destructors called in reverse order? What is the output: class A{public: ~A()=delete;}; {A a... What happens if constructor throws an exception? 📚 Related Topic Introduction to C++ (187) Variables and Data Types (160) Operators in C++ (163)
26 Question 26 EN + हिं GB When are destructors called in reverse order? IN विध्वंसकों को उल्टे क्रम में कब बुलाया जाता है? A For objects declared in same scope समान दायरे में घोषित वस्तुओं के लिए B For base and derived classes आधार और व्युत्पन्न वर्गों के लिए C For array elements सरणी तत्वों के लिए D All of the above ऊपर के सभी ✅ Correct Answer: 💡 Explanation / व्याख्या Explanation (English) Destructors are called in reverse order of construction for objects in the same scope, array elements (reverse index), and derived/base class (derived first). व्याख्या (हिन्दी) विनाशकों को समान दायरे, सरणी तत्वों (रिवर्स इंडेक्स), और व्युत्पन्न/आधार वर्ग (पहले व्युत्पन्न) में वस्तुओं के लिए निर्माण के विपरीत क्रम में बुलाया जाता है। 🎯 Exam Perspective Railway, SSC, Banking और Defence परीक्षाओं जैसी परीक्षाओं में OOP Using C++ ("Constructors and Destructors" sub-topic) से सवाल अक्सर पूछे जाते हैं। इसलिए सिर्फ answer रटने के बजाय, नीचे दी गई explanation को ध्यान से पढ़ें और concept समझें। 🔗 Related Questions What is the output: class A{public: A(){cout What happens if constructor throws an exception? What is the output: class A{public: A(){x=++c;} static... 📚 Related Topic Introduction to C++ (187) Variables and Data Types (160) Operators in C++ (163)
27 Question 27 EN + हिं GB What is the output: class A{int x; public: explicit A(int v):x(v){} int get()const{return x;}}; A a=A(5); cout< IN आउटपुट क्या है: class A{int x; सार्वजनिक: स्पष्ट A(int v):x(v){} int get()const{return x;}}; ए ए=ए(5); अदालत A 5 5 C Compile error संकलन त्रुटि D Undefined अपरिभाषित ✅ Correct Answer: 💡 Explanation / व्याख्या Explanation (English) A(5) is direct initialization; explicit prevents implicit conversion but direct is fine. a.get()=5. व्याख्या (हिन्दी) ए(5) प्रत्यक्ष आरंभीकरण है; स्पष्ट रूप से अंतर्निहित रूपांतरण को रोकता है लेकिन प्रत्यक्ष ठीक है। a.get()=5. 🎯 Exam Perspective अगर आप SSC, Railway, Banking और State PCS की तैयारी कर रहे हैं, तो OOP Using C++ ("Constructors and Destructors" sub-topic) का यह topic आपके लिए महत्वपूर्ण है। Exam में accuracy बढ़ाने के लिए हर सवाल की explanation जरूर पढ़ें। 🔗 Related Questions What is 'Rule of Five' in C++11? What is the output: class A{public: int x=0; A()=defaul... What is the output: class A{public: A(){cout 📚 Related Topic Introduction to C++ (187) Variables and Data Types (160) Operators in C++ (163)
28 Question 28 EN + हिं GB What is the output: class A{public: A(int x=10,int y=20){cout< IN आउटपुट क्या है: वर्ग A{सार्वजनिक: A(int x=10,int y=20){cout A 303011 303011 B 302511 302511 C Compile error संकलन त्रुटि D Undefined अपरिभाषित ✅ Correct Answer: 💡 Explanation / व्याख्या Explanation (English) a: 10+20=30, b(5): 5+20=25, c(5,6): 5+6=11. Output: 302511. व्याख्या (हिन्दी) ए: 10+20=30, बी(5): 5+20=25, सी(5,6): 5+6=11। आउटपुट: 302511. 🎯 Exam Perspective OOP Using C++ ("Constructors and Destructors" sub-topic) के इस प्रश्न को कई प्रतियोगी परीक्षाओं जैसे SSC CGL, IBPS, RRB और State-level परीक्षाओं में repeat होते देखा गया है। Concept clarity के लिए explanation section जरूर पढ़ें। 🔗 Related Questions What is 'trivial destructor'? What happens if constructor throws an exception? What is the output: class A{public: A(){x=++c;} static... 📚 Related Topic Introduction to C++ (187) Variables and Data Types (160) Operators in C++ (163)
29 Question 29 EN + हिं GB What is the output: class A{public: ~A()=delete;}; {A a;} IN आउटपुट क्या है: क्लास ए{सार्वजनिक: ~ए()=डिलीट;}; {ए ए;} A Compile error संकलन त्रुटि B Undefined अपरिभाषित C A ए D Nothing कुछ नहीं ✅ Correct Answer: 💡 Explanation / व्याख्या Explanation (English) Deleting destructor prevents any object with automatic storage duration; compile error. व्याख्या (हिन्दी) विध्वंसक को हटाने से स्वचालित भंडारण अवधि वाली किसी भी वस्तु को रोका जा सकता है; संकलन त्रुटि. 🎯 Exam Perspective यह सवाल OOP Using C++ ("Constructors and Destructors" sub-topic) category का है, और UPSC, SSC, Banking और Police भर्ती के exam pattern में इस तरह के questions common हैं। Answer choose करने के बाद दिया गया explanation जरूर पढ़ें। 🔗 Related Questions What is a 'converting constructor'? What is the output: class A{public: ~A(){cout What is the output: class A{public: A(){x=++c;} static... 📚 Related Topic Introduction to C++ (187) Variables and Data Types (160) Operators in C++ (163)
30 Question 30 EN + हिं GB What is 'trivial destructor'? IN 'तुच्छ विध्वंसक' क्या है? A Destructor that does nothing and is compiler-generated डिस्ट्रक्टर जो कुछ नहीं करता है और कंपाइलर-जनरेटेड है B Empty user-defined destructor उपयोगकर्ता-परिभाषित विध्वंसक को खाली करें C Virtual destructor आभासी विध्वंसक D Static destructor स्थैतिक विध्वंसक ✅ Correct Answer: 💡 Explanation / व्याख्या Explanation (English) A trivial destructor is implicitly defined, does nothing, and allows objects to be destroyed without calling it (e.g., via free()). व्याख्या (हिन्दी) एक तुच्छ विध्वंसक को स्पष्ट रूप से परिभाषित किया गया है, कुछ भी नहीं करता है, और वस्तुओं को बिना कॉल किए नष्ट करने की अनुमति देता है (उदाहरण के लिए, free() के माध्यम से)। 🎯 Exam Perspective यह प्रश्न OOP Using C++ ("Constructors and Destructors" sub-topic) की तैयारी करने वाले अभ्यर्थियों के लिए उपयोगी है। इस तरह के प्रश्न अक्सर Railway, SSC, Banking और Defence परीक्षाओं जैसी परीक्षाओं में पूछे जाते रहे हैं, इसलिए concept और explanation दोनों को ध्यान से समझें, सिर्फ उत्तर याद न करें। 🔗 Related Questions What is 'move constructor'? What is the output: class A{public: ~A()=delete;}; {A a... What is the output: class A{public: A(int x=10,int y=20... 📚 Related Topic Introduction to C++ (187) Variables and Data Types (160) Operators in C++ (163)