61 Question 61 EN + हिं GB What is the output: class T{public: T(){cout<<'T';} T(const T&){cout<<'C';} ~T(){cout<<'D';}}; T f(T t){return t;} T a; f(a); IN आउटपुट क्या है: क्लास टी{पब्लिक: टी(){काउट A TCCDD टीसीसीडीडी B Depends on optimization अनुकूलन पर निर्भर करता है C Compile error संकलन त्रुटि D Undefined अपरिभाषित ✅ Correct Answer: 💡 Explanation / व्याख्या Explanation (English) With NRVO: T constructed (T), copy to param (C), copy return (C or elided), destructors. Optimization dependent. व्याख्या (हिन्दी) एनआरवीओ के साथ: टी निर्मित (टी), कॉपी टू पैरा (सी), कॉपी रिटर्न (सी या एलिडेड), डिस्ट्रक्टर्स। अनुकूलन निर्भर. 🎯 Exam Perspective OOP Using C++ ("Constructors and Destructors" sub-topic) से जुड़ा यह सवाल उन students के लिए काम का है जो UPSC, SSC, Banking और Police भर्ती की तैयारी कर रहे हैं। बेहतर होगा कि explanation पढ़कर concept clear करें, ताकि exam में similar प्रश्न आने पर confusion न हो। 🔗 Related Questions What is the output: class A{public:int x; constexpr A(i... What is the output: class A{public:int x=10; A(const A&... What is the output: class A{public:int x; A():x(0){} A(... 📚 Related Topic Introduction to C++ (187) Variables and Data Types (160) Operators in C++ (163)
62 Question 62 EN + हिं GB What is the output: class A{public:int x; A(int v):x(v*v){}}; A a(4); cout< IN आउटपुट क्या है: class A{public:int x; A(int v):x(v*v){}}; ए ए(4); अदालत A 16 16 B 4 4 C Compile error संकलन त्रुटि D Undefined अपरिभाषित ✅ Correct Answer: 💡 Explanation / व्याख्या Explanation (English) x=4*4=16. Output: 16. व्याख्या (हिन्दी) x=4*4=16. आउटपुट: 16. 🎯 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:int x; constexpr A(i... What is the output: class T{public: T(){cout What is the output: class A{public:int x=0,y=0; A()=def... 📚 Related Topic Introduction to C++ (187) Variables and Data Types (160) Operators in C++ (163)
63 Question 63 EN + हिं GB What is the output: class A{public:A(){cout<<1;} A(int){cout<<2;} A(int,int){cout<<3;}}; A a; A b(1); A c(1,2); IN आउटपुट क्या है: क्लास ए {पब्लिक: ए() {काउट A 123 123 B 111 111 C Compile error संकलन त्रुटि D Undefined अपरिभाषित ✅ Correct Answer: 💡 Explanation / व्याख्या Explanation (English) a: default=1; b(1): int=2; c(1,2): int,int=3. Output: 123. व्याख्या (हिन्दी) ए: डिफ़ॉल्ट=1; बी(1): int=2; सी(1,2): int,int=3. आउटपुट: 123. 🎯 Exam Perspective अगर आप SSC, Railway, Banking और State PCS की तैयारी कर रहे हैं, तो OOP Using C++ ("Constructors and Destructors" 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=10; A(const A&... What is the output: class A{public:int x; A(int v):x(v)... 📚 Related Topic Introduction to C++ (187) Variables and Data Types (160) Operators in C++ (163)
64 Question 64 EN + हिं GB What is the output: class A{public:int x; constexpr A(int v):x(v){}}; constexpr A a(5); cout< IN आउटपुट क्या है: class A{public:int x; constexpr A(int v):x(v){}}; constexpr ए ए(5); अदालत A 5 5 C Compile error संकलन त्रुटि D Undefined अपरिभाषित ✅ Correct Answer: 💡 Explanation / व्याख्या Explanation (English) constexpr ctor creates a at compile time. a.x=5. Output: 5. व्याख्या (हिन्दी) संकलन समय पर constexpr ctor एक बनाता है। a.x=5. आउटपुट: 5. 🎯 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 the output: class A{public:int x=0,y=0; A()=def... What is the output: class A{public:~A(){cout What is the output: class A{public:int x; A():x(0){} A(... 📚 Related Topic Introduction to C++ (187) Variables and Data Types (160) Operators in C++ (163)
65 Question 65 EN + हिं GB What is the output: class A{public:int x=0;}; class B:public A{public:B(){x=5;}}; B b; cout< IN आउटपुट क्या है: class A{public:int x=0;}; कक्षा बी:सार्वजनिक ए{सार्वजनिक:बी(){x=5;}}; बी बी; अदालत A 5 5 C Compile error संकलन त्रुटि D Undefined अपरिभाषित ✅ Correct Answer: 💡 Explanation / व्याख्या Explanation (English) B() sets x=5. Output: 5. व्याख्या (हिन्दी) बी() x=5 सेट करता है। आउटपुट: 5. 🎯 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:int x; A(int v):x(v*... What is the output: class T{public: T(){cout What is the output: class A{public:int x; constexpr A(i... 📚 Related Topic Introduction to C++ (187) Variables and Data Types (160) Operators in C++ (163)
66 Question 66 EN + हिं GB What is the output: class A{public:int x; A(int v):x(v){} A(const A& o):x(o.x*2){}}; A a(3); A b(a); A c(b); cout< IN आउटपुट क्या है: class A{public:int x; A(int v):x(v){} A(const A& o):x(o.x*2){}}; ए ए(3); ए बी(ए); ए सी(बी); अदालत A 3612 3612 B 336 336 C Compile error संकलन त्रुटि D Undefined अपरिभाषित ✅ Correct Answer: 💡 Explanation / व्याख्या Explanation (English) a.x=3; b.x=3*2=6; c.x=6*2=12. Output: 3612. व्याख्या (हिन्दी) a.x=3; b.x=3*2=6; c.x=6*2=12. आउटपुट: 3612. 🎯 Exam Perspective यह प्रश्न OOP Using C++ ("Constructors and Destructors" sub-topic) की तैयारी करने वाले अभ्यर्थियों के लिए उपयोगी है। इस तरह के प्रश्न अक्सर UPSC, SSC, Banking और Police भर्ती जैसी परीक्षाओं में पूछे जाते रहे हैं, इसलिए concept और explanation दोनों को ध्यान से समझें, सिर्फ उत्तर याद न करें। 🔗 Related Questions What is the output: class A{public:int x=0,y=0; A()=def... 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)
67 Question 67 EN + हिं GB What is the output: class A{int x=0; public: A&operator=(int v){x=v;return *this;} int get()const{return x;}}; A a; a=5; cout< IN आउटपुट क्या है: class A{int x=0; सार्वजनिक: A&operator=(int v){x=v;return *this;} int get()const{return x;}}; ए ए; ए=5; अदालत A 5 5 C Compile error संकलन त्रुटि D Undefined अपरिभाषित ✅ Correct Answer: 💡 Explanation / व्याख्या Explanation (English) a=5: operator=(5): x=5. Output: 5. व्याख्या (हिन्दी) a=5: ऑपरेटर=(5): x=5. आउटपुट: 5. 🎯 Exam Perspective OOP Using C++ ("Constructors and Destructors" sub-topic) से जुड़ा यह सवाल उन students के लिए काम का है जो Railway, SSC, Banking और Defence परीक्षाओं की तैयारी कर रहे हैं। बेहतर होगा कि explanation पढ़कर concept clear करें, ताकि exam में similar प्रश्न आने पर confusion न हो। 🔗 Related Questions What is the output: class A{public:int x; A():x(0){} A(... What is the output: class A{public:int x=0;}; class B:p... What is the output: class A{int x; public: void setX(in... 📚 Related Topic Introduction to C++ (187) Variables and Data Types (160) Operators in C++ (163)
68 Question 68 EN + हिं GB What is the output: class A{public:~A(){cout<<'X';} A()=default; A(A&&)=default;}; A f(){return A();} A a=f(); cout<<'Y'; IN आउटपुट क्या है: क्लास ए{पब्लिक:~ए(){काउट A XY XY B YX YX C Y वाई D Compile error संकलन त्रुटि ✅ Correct Answer: 💡 Explanation / व्याख्या Explanation (English) C++17 mandatory elision: no move/copy needed. a created directly. At end: ~a prints X. But cout<<'Y' first. Output: YX. व्याख्या (हिन्दी) C++17 अनिवार्य एलिज़न: कोई स्थानांतरण/प्रतिलिपि की आवश्यकता नहीं है। एक सीधे बनाया गया. अंत में: ~a X प्रिंट करता है। लेकिन कॉउट 🎯 Exam Perspective SSC, Railway, Banking और State PCS जैसी परीक्षाओं में OOP Using C++ ("Constructors and Destructors" sub-topic) से सवाल अक्सर पूछे जाते हैं। इसलिए सिर्फ answer रटने के बजाय, नीचे दी गई explanation को ध्यान से पढ़ें और concept समझें। 🔗 Related Questions What is the output: class A{public:int x=10; A(const A&... What is the output: class T{public: T(){cout What is the output: class A{public:int x; A(int v):x(v*... 📚 Related Topic Introduction to C++ (187) Variables and Data Types (160) Operators in C++ (163)
69 Question 69 EN + हिं GB What is the output: class A{public:int x; A():x(0){} A(int v):x(v){}}; A arr[3]={1,2,3}; cout< IN आउटपुट क्या है: class A{public:int x; A():x(0){} A(int v):x(v){}}; एक गिरफ्तारी[3]={1,2,3}; अदालत A 13 13 B 31 31 C Compile error संकलन त्रुटि D Undefined अपरिभाषित ✅ Correct Answer: 💡 Explanation / व्याख्या Explanation (English) arr[0].x=1, arr[2].x=3. Output: 13. व्याख्या (हिन्दी) गिरफ्तारी[0].x=1, गिरफ्तारी[2].x=3. आउटपुट: 13. 🎯 Exam Perspective अगर आप SSC CGL, IBPS, RRB और State-level परीक्षाओं की तैयारी कर रहे हैं, तो OOP Using C++ ("Constructors and Destructors" sub-topic) का यह topic आपके लिए महत्वपूर्ण है। Exam में accuracy बढ़ाने के लिए हर सवाल की explanation जरूर पढ़ें। 🔗 Related Questions What is the output: class A{public:~A(){cout What is the output: class A{public:int x; constexpr A(i... What is the output: class A{public:A(){cout 📚 Related Topic Introduction to C++ (187) Variables and Data Types (160) Operators in C++ (163)
70 Question 70 EN + हिं GB What is the output: class A{public:int x=0; ~A(){x=-1;} int getAfterDtor(){return x;}}; A *p=new A; delete p; // p->getAfterDtor() would be UB IN आउटपुट क्या है: class A{public:int x=0; ~A(){x=-1;} int getAfterDtor(){return x;}}; ए *पी=नया ए; पी हटाएं; // p->getAfterDtor() यूबी होगा A Undefined behavior अपरिभाषित व्यवहार C -1 -1 D Compile error संकलन त्रुटि ✅ Correct Answer: 💡 Explanation / व्याख्या Explanation (English) Accessing deleted object is UB. व्याख्या (हिन्दी) हटाए गए ऑब्जेक्ट तक पहुंच यूबी है। 🎯 Exam Perspective OOP Using C++ ("Constructors and Destructors" sub-topic) के इस प्रश्न को कई प्रतियोगी परीक्षाओं जैसे UPSC, SSC, Banking और Police भर्ती में repeat होते देखा गया है। Concept clarity के लिए explanation section जरूर पढ़ें। 🔗 Related Questions What is the output: class A{public:int x; A():x(0){} A(... What is the output: class A{public:int x; constexpr A(i... What is the output: class A{public:A(){cout 📚 Related Topic Introduction to C++ (187) Variables and Data Types (160) Operators in C++ (163)
71 Question 71 EN + हिं GB What is the output: class A{public:int x; constexpr A(int v):x(v*v){}}; constexpr A a(4); cout< IN आउटपुट क्या है: class A{public:int x; constexpr A(int v):x(v*v){}}; constexpr ए ए(4); अदालत A 16 16 B 4 4 C Compile error संकलन त्रुटि D Undefined अपरिभाषित ✅ Correct Answer: 💡 Explanation / व्याख्या Explanation (English) constexpr A(4): x=16. Output: 16. व्याख्या (हिन्दी) constexpr A(4): x=16. आउटपुट: 16. 🎯 Exam Perspective यह सवाल OOP Using C++ ("Constructors and Destructors" sub-topic) category का है, और Railway, SSC, Banking और Defence परीक्षाओं के exam pattern में इस तरह के questions common हैं। Answer choose करने के बाद दिया गया explanation जरूर पढ़ें। 🔗 Related Questions What is the output: class A{public:~A(){cout What is the output: class A{public:int x=0,y=0; A()=def... What is the output: class A{public:A(){cout 📚 Related Topic Introduction to C++ (187) Variables and Data Types (160) Operators in C++ (163)
72 Question 72 EN + हिं GB What is the output: class A{public:int x=0,y=0; A()=default; A(int a,int b):x(a),y(b){}}; A a{3,4}; cout< IN आउटपुट क्या है: class A{public:int x=0,y=0; ए()=डिफ़ॉल्ट; A(int a,int b):x(a),y(b){}}; ए ए{3,4}; अदालत A 34 34 B Compile error संकलन त्रुटि C Undefined अपरिभाषित D 00 00 ✅ Correct Answer: 💡 Explanation / व्याख्या Explanation (English) A has user-provided constructor so not aggregate; A a{3,4} calls A(int,int). Output: 34. व्याख्या (हिन्दी) A के पास उपयोगकर्ता द्वारा प्रदत्त कंस्ट्रक्टर है इसलिए समग्र नहीं; A a{3,4} A(int,int) को कॉल करता है। आउटपुट: 34. 🎯 Exam Perspective यह प्रश्न OOP Using C++ ("Constructors and Destructors" sub-topic) की तैयारी करने वाले अभ्यर्थियों के लिए उपयोगी है। इस तरह के प्रश्न अक्सर SSC, Railway, Banking और State PCS जैसी परीक्षाओं में पूछे जाते रहे हैं, इसलिए concept और explanation दोनों को ध्यान से समझें, सिर्फ उत्तर याद न करें। 🔗 Related Questions What is the output: class A{public:~A(){cout What is the output: class T{public: T(){cout What is the output: class A{public:int x=0; ~A(){x=-1;}... 📚 Related Topic Introduction to C++ (187) Variables and Data Types (160) Operators in C++ (163)
73 Question 73 EN + हिं GB What is the output: class A{int x; public: void setX(int v){x=v;} int getX()const{return x;} A(int v=0):x(v){}}; vector v(3); v[1].setX(5); cout< IN आउटपुट क्या है: class A{int x; सार्वजनिक: void setX(int v){x=v;} int getX()const{return x;} A(int v=0):x(v){}}; वेक्टर वी(3); v[1].setX(5); अदालत A 5 5 C Compile error संकलन त्रुटि D Undefined अपरिभाषित ✅ Correct Answer: 💡 Explanation / व्याख्या Explanation (English) v[1].x=5. getX()=5. Output: 5. व्याख्या (हिन्दी) v[1].x=5. गेटएक्स()=5. आउटपुट: 5. 🎯 Exam Perspective OOP Using C++ ("Constructors and Destructors" sub-topic) से जुड़ा यह सवाल उन students के लिए काम का है जो SSC CGL, IBPS, RRB और State-level परीक्षाओं की तैयारी कर रहे हैं। बेहतर होगा कि explanation पढ़कर concept clear करें, ताकि exam में similar प्रश्न आने पर confusion न हो। 🔗 Related Questions What is the output: class T{public: T(){cout What is the output: class A{public:int x; A():x(0){} A(... What is the output: class A{public:A(){cout 📚 Related Topic Introduction to C++ (187) Variables and Data Types (160) Operators in C++ (163)
74 Question 74 EN + हिं GB What is the output: class A{public:int x; A(int v):x(v){} bool operator<(const A& o)const{return x IN आउटपुट क्या है: class A{public:int x; A(int v):x(v){} बूल ऑपरेटर A 1 1 B 3 3 C Compile error संकलन त्रुटि D Undefined अपरिभाषित ✅ Correct Answer: 💡 Explanation / व्याख्या Explanation (English) min uses operator<; min is c.x=1. Output: 1. व्याख्या (हिन्दी) न्यूनतम ऑपरेटर का उपयोग करता है 🎯 Exam Perspective UPSC, SSC, Banking और Police भर्ती जैसी परीक्षाओं में OOP Using C++ ("Constructors and Destructors" sub-topic) से सवाल अक्सर पूछे जाते हैं। इसलिए सिर्फ answer रटने के बजाय, नीचे दी गई explanation को ध्यान से पढ़ें और concept समझें। 🔗 Related Questions What is the output: class A{public:int x; constexpr A(i... What is the output: class A{public:int x; A(int v):x(v*... What is the output: class A{public:int x=0,y=0; A()=def... 📚 Related Topic Introduction to C++ (187) Variables and Data Types (160) Operators in C++ (163)
75 Question 75 EN + हिं GB What is the output: class A{public:int x=10; A(const A& o):x(o.x-1){} A()=default;}; A a; A b=a; A c=b; A d=c; cout< IN आउटपुट क्या है: class A{public:int x=10; A(const A&o):x(o.x-1){} A()=default;}; ए ए; ए बी=ए; ए सी=बी; ए डी=सी; अदालत A 10 9 8 7 10 9 8 7 B Compile error संकलन त्रुटि C Undefined अपरिभाषित D option_b विकल्प_बी ✅ Correct Answer: 💡 Explanation / व्याख्या Explanation (English) See explanation. व्याख्या (हिन्दी) स्पष्टीकरण देखें. 🎯 Exam Perspective अगर आप Railway, SSC, Banking और Defence परीक्षाओं की तैयारी कर रहे हैं, तो OOP Using C++ ("Constructors and Destructors" sub-topic) का यह topic आपके लिए महत्वपूर्ण है। Exam में accuracy बढ़ाने के लिए हर सवाल की explanation जरूर पढ़ें। 🔗 Related Questions What is the output: class A{public:int x; constexpr A(i... What is the output: class A{public:int x=0; ~A(){x=-1;}... What is the output: class A{public:int x; A(int v):x(v*... 📚 Related Topic Introduction to C++ (187) Variables and Data Types (160) Operators in C++ (163)