16 Question 16 EN + हिं GB What is the output: try{throw 1;}catch(long l){cout<<'L';}catch(int i){cout<<'I';} IN आउटपुट क्या है: प्रयास करें {थ्रो 1;} कैच (लॉन्ग एल) {काउट A L एल B I मैं C Compile error संकलन त्रुटि D Undefined अपरिभाषित ✅ Correct Answer: 💡 Explanation / व्याख्या Explanation (English) No implicit conversion in exception catching; int matches catch(int) not catch(long). Output: I. व्याख्या (हिन्दी) अपवाद पकड़ने में कोई अंतर्निहित रूपांतरण नहीं; int कैच (int) से मेल खाता है, कैच (लंबा) से नहीं। आउटपुट: मैं. 🎯 Exam Perspective OOP Using C++ ("Exception Handling" sub-topic) के इस प्रश्न को कई प्रतियोगी परीक्षाओं जैसे SSC, Railway, Banking और State PCS में repeat होते देखा गया है। Concept clarity के लिए explanation section जरूर पढ़ें। 🔗 Related Questions What is the output: try{throw 1;}catch(int i){cout What is 'function-try-block'? What is the output: struct Base{virtual ~Base()=default... 📚 Related Topic Introduction to C++ (187) Variables and Data Types (160) Operators in C++ (163)
17 Question 17 EN + हिं GB What is 'RETHROW' in C++? IN C++ में 'रेथ्रो' क्या है? A throw; inside catch block re-throws current exception फेंक; कैच ब्लॉक के अंदर वर्तमान अपवाद को फिर से फेंकता है B throw exception from catch कैच से अपवाद फेंकें C Copy of exception thrown अपवाद की प्रतिलिपि फेंकी गई D New exception from catch पकड़ से नया अपवाद ✅ Correct Answer: 💡 Explanation / व्याख्या Explanation (English) throw; (no argument) inside a catch handler rethrows the current exception preserving its type. व्याख्या (हिन्दी) फेंक; (कोई तर्क नहीं) कैच हैंडलर के अंदर वर्तमान अपवाद को उसके प्रकार को संरक्षित करते हुए पुनर्स्थापित करता है। 🎯 Exam Perspective यह सवाल OOP Using C++ ("Exception Handling" sub-topic) category का है, और SSC CGL, IBPS, RRB और State-level परीक्षाओं के exam pattern में इस तरह के questions common हैं। Answer choose करने के बाद दिया गया explanation जरूर पढ़ें। 🔗 Related Questions What is the output: try{vector v; v.at(5);}catch(out_of... What is the output: try{throw;}catch(...){cout What is 'std::terminate' called in situations besides u... 📚 Related Topic Introduction to C++ (187) Variables and Data Types (160) Operators in C++ (163)
18 Question 18 EN + हिं GB What is the output: struct Base{virtual ~Base()=default;}; struct Der:Base{}; try{throw Der();}catch(Base& b){cout<<'B';}catch(Der& d){cout<<'D';} IN आउटपुट क्या है: struct Base{virtual ~Base()=default;}; संरचना डेर:बेस{}; प्रयास करें{थ्रो डेर();}कैच(बेस& बी){काउट A B बी B D डी C Compile error संकलन त्रुटि D BD बी.डी ✅ Correct Answer: 💡 Explanation / व्याख्या Explanation (English) Catch handlers tried in order. Der is-a Base, so catch(Base&) matches first. Output: B. (Put more specific catch first!) व्याख्या (हिन्दी) कैच संचालकों ने क्रम में प्रयास किया। डेर एक बेस है, इसलिए कैच(बेस&) पहले मेल खाता है। आउटपुट: बी. (पहले अधिक विशिष्ट कैच डालें!) 🎯 Exam Perspective यह प्रश्न OOP Using C++ ("Exception Handling" sub-topic) की तैयारी करने वाले अभ्यर्थियों के लिए उपयोगी है। इस तरह के प्रश्न अक्सर UPSC, SSC, Banking और Police भर्ती जैसी परीक्षाओं में पूछे जाते रहे हैं, इसलिए concept और explanation दोनों को ध्यान से समझें, सिर्फ उत्तर याद न करें। 🔗 Related Questions What is the output: try{throw std::runtime_error("fail"... What is 'nested exception' in C++? What is the output: struct A{A(){throw 1;} ~A(){cout 📚 Related Topic Introduction to C++ (187) Variables and Data Types (160) Operators in C++ (163)
19 Question 19 EN + हिं GB What is 'std::terminate' called in situations besides uncaught exception? IN अज्ञात अपवाद के अलावा अन्य स्थितियों में 'std::terminet' को क्या कहा जाता है? A noexcept function throws, or exception in destructor during unwinding अनवाइंडिंग के दौरान नोएक्सेप्ट फ़ंक्शन थ्रो, या डिस्ट्रक्टर में अपवाद B Out of memory स्मृति से बाहर C Stack overflow स्टैक ओवरफ़्लो D Null pointer dereference शून्य सूचक डीरेफ़रेंस ✅ Correct Answer: 💡 Explanation / व्याख्या Explanation (English) std::terminate is called: uncaught exception, noexcept violation, exception during stack unwinding, bad terminate() etc. व्याख्या (हिन्दी) एसटीडी::टर्मिनेट को कहा जाता है: अनकहा अपवाद, नोएक्सेप्ट उल्लंघन, स्टैक अनवाइंडिंग के दौरान अपवाद, खराब टर्मिनेट() आदि। 🎯 Exam Perspective OOP Using C++ ("Exception Handling" sub-topic) से जुड़ा यह सवाल उन students के लिए काम का है जो Railway, SSC, Banking और Defence परीक्षाओं की तैयारी कर रहे हैं। बेहतर होगा कि explanation पढ़कर concept clear करें, ताकि exam में similar प्रश्न आने पर confusion न हो। 🔗 Related Questions What is 'nested exception' in C++? What is the output: void f() noexcept(false){throw 1;}... What is the output: try{throw 1;}catch(long l){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: try{throw;}catch(...){cout<<'X';} IN आउटपुट क्या है: प्रयास करें {फेंकें;} पकड़ें (...) {काउट करें A X एक्स B std::terminate एसटीडी::समाप्त C Compile error संकलन त्रुटि D Undefined अपरिभाषित ✅ Correct Answer: 💡 Explanation / व्याख्या Explanation (English) Re-throw with no active exception calls std::terminate. व्याख्या (हिन्दी) बिना किसी सक्रिय अपवाद के पुनः थ्रो करें कॉल std::समाप्त करें। 🎯 Exam Perspective SSC, Railway, Banking और State PCS जैसी परीक्षाओं में OOP Using C++ ("Exception Handling" sub-topic) से सवाल अक्सर पूछे जाते हैं। इसलिए सिर्फ answer रटने के बजाय, नीचे दी गई explanation को ध्यान से पढ़ें और concept समझें। 🔗 Related Questions What is the output: try{throw 1;}catch(long l){cout What is 'nested exception' in C++? What is 'exception neutral' code? 📚 Related Topic Introduction to C++ (187) Variables and Data Types (160) Operators in C++ (163)
21 Question 21 EN + हिं GB What is the output: try{try{throw 1;}catch(int i){throw i+1;}}catch(int i){cout< IN आउटपुट क्या है: प्रयास करें {कोशिश करें 1 फेंकें;} पकड़ें (int i) {फेंकें i + 1; A 2 2 B 1 1 C Compile error संकलन त्रुटि D Undefined अपरिभाषित ✅ Correct Answer: 💡 Explanation / व्याख्या Explanation (English) Inner catch catches 1, throws i+1=2. Outer catch catches 2. Output: 2. व्याख्या (हिन्दी) इनर कैच कैच 1, थ्रो i+1=2. बाहरी कैच कैच 2. आउटपुट: 2. 🎯 Exam Perspective अगर आप SSC CGL, IBPS, RRB और State-level परीक्षाओं की तैयारी कर रहे हैं, तो OOP Using C++ ("Exception Handling" sub-topic) का यह topic आपके लिए महत्वपूर्ण है। Exam में accuracy बढ़ाने के लिए हर सवाल की explanation जरूर पढ़ें। 🔗 Related Questions What is the output: try{vector v; v.at(5);}catch(out_of... What is the output: struct A{A(){throw 1;} ~A(){cout What is the output: try{throw std::runtime_error("fail"... 📚 Related Topic Introduction to C++ (187) Variables and Data Types (160) Operators in C++ (163)
22 Question 22 EN + हिं GB What is 'function-try-block'? IN 'फ़ंक्शन-ट्राई-ब्लॉक' क्या है? A Try-catch wrapping entire function including member initializer list सदस्य इनिशियलाइज़र सूची सहित संपूर्ण फ़ंक्शन को रैप करने का प्रयास करें B Exception in function body only केवल फ़ंक्शन बॉडी में अपवाद C A macro for try-catch प्रयास-पकड़ने के लिए एक मैक्रो D Template exception handling टेम्प्लेट अपवाद प्रबंधन ✅ Correct Answer: 💡 Explanation / व्याख्या Explanation (English) Function-try-block: A()try:x(init()){}catch(...){} — catches exceptions in member initializer list. व्याख्या (हिन्दी) फ़ंक्शन-ट्राई-ब्लॉक: A()try:x(init()){}catch(...){} - सदस्य इनिशियलाइज़र सूची में अपवादों को पकड़ता है। 🎯 Exam Perspective OOP Using C++ ("Exception Handling" sub-topic) के इस प्रश्न को कई प्रतियोगी परीक्षाओं जैसे UPSC, SSC, Banking और Police भर्ती में repeat होते देखा गया है। Concept clarity के लिए explanation section जरूर पढ़ें। 🔗 Related Questions What is the output: int x=0; try{x=1; throw 1; x=2;}cat... What is 'std::terminate' called in situations besides u... What is 'RETHROW' in C++? 📚 Related Topic Introduction to C++ (187) Variables and Data Types (160) Operators in C++ (163)
23 Question 23 EN + हिं GB What is the output: void f() noexcept(false){throw 1;} void g() noexcept{f();} try{g();}catch(...){cout<<'C';} IN आउटपुट क्या है: void f() noexcept(false){throw 1;} void g() noexcept{f();} Try{g();}catch(...){cout A C सी B std::terminate एसटीडी::समाप्त C Compile error संकलन त्रुटि D Undefined अपरिभाषित ✅ Correct Answer: 💡 Explanation / व्याख्या Explanation (English) g() is noexcept; when f() throws, the exception escapes g(), triggering terminate(). व्याख्या (हिन्दी) g() कोई अपवाद नहीं है; जब f() फेंकता है, तो अपवाद g() से बच जाता है, जिससे समाप्ति() ट्रिगर हो जाती है। 🎯 Exam Perspective यह सवाल OOP Using C++ ("Exception Handling" sub-topic) category का है, और Railway, SSC, Banking और Defence परीक्षाओं के exam pattern में इस तरह के questions common हैं। Answer choose करने के बाद दिया गया explanation जरूर पढ़ें। 🔗 Related Questions What is the output: try{throw;}catch(...){cout What is the output: struct A{A(){throw 1;} ~A(){cout What is the output: int x=0; try{x=1; throw 1; x=2;}cat... 📚 Related Topic Introduction to C++ (187) Variables and Data Types (160) Operators in C++ (163)
24 Question 24 EN + हिं GB What is the output: try{throw std::runtime_error("fail");}catch(std::exception& e){cout< IN आउटपुट क्या है: प्रयास करें{थ्रो std::runtime_error('fail');}catch(std::exception& e){cout A fail असफल B runtime_error रनटाइम त्रुटि C Compile error संकलन त्रुटि D Undefined अपरिभाषित ✅ Correct Answer: 💡 Explanation / व्याख्या Explanation (English) std::runtime_error inherits std::exception. what() returns the message "fail". Output: fail. व्याख्या (हिन्दी) std::runtime_error को std::अपवाद विरासत में मिला है। क्या() संदेश "विफल" लौटाता है। आउटपुट: असफल. 🎯 Exam Perspective यह प्रश्न OOP Using C++ ("Exception Handling" sub-topic) की तैयारी करने वाले अभ्यर्थियों के लिए उपयोगी है। इस तरह के प्रश्न अक्सर SSC, Railway, Banking और State PCS जैसी परीक्षाओं में पूछे जाते रहे हैं, इसलिए concept और explanation दोनों को ध्यान से समझें, सिर्फ उत्तर याद न करें। 🔗 Related Questions What is 'std::terminate' called in situations besides u... What is the output: void f() noexcept(false){throw 1;}... What is 'nested exception' in C++? 📚 Related Topic Introduction to C++ (187) Variables and Data Types (160) Operators in C++ (163)
25 Question 25 EN + हिं GB What is 'exception neutral' code? IN 'अपवाद तटस्थ' कोड क्या है? A Code that doesn't catch exceptions but allows them to propagate कोड जो अपवादों को नहीं पकड़ता बल्कि उन्हें प्रचारित करने की अनुमति देता है B Code with no exceptions possible बिना किसी अपवाद के कोड संभव है C noexcept everywhere हर जगह छोड़कर नहीं D Try-catch everywhere हर जगह पकड़ने की कोशिश करो ✅ Correct Answer: 💡 Explanation / व्याख्या Explanation (English) Exception neutral code lets exceptions pass through transparently, maintaining strong safety guarantee. व्याख्या (हिन्दी) अपवाद तटस्थ कोड मजबूत सुरक्षा गारंटी बनाए रखते हुए अपवादों को पारदर्शी रूप से पारित करने देता है। 🎯 Exam Perspective OOP Using C++ ("Exception Handling" sub-topic) से जुड़ा यह सवाल उन students के लिए काम का है जो SSC CGL, IBPS, RRB और State-level परीक्षाओं की तैयारी कर रहे हैं। बेहतर होगा कि explanation पढ़कर concept clear करें, ताकि exam में similar प्रश्न आने पर confusion न हो। 🔗 Related Questions What is the output: try{throw 1;}catch(int i){cout What is the output: try{throw std::runtime_error("fail"... What is the output: try{throw 1;}catch(long l){cout 📚 Related Topic Introduction to C++ (187) Variables and Data Types (160) Operators in C++ (163)
26 Question 26 EN + हिं GB What is the output: struct A{A(){throw 1;} ~A(){cout<<'D';}}; try{A a;}catch(int){cout<<'C';} IN आउटपुट क्या है: struct A{A(){throw 1;} ~A(){cout A DC डीसी B CD सीडी C C सी D Compile error संकलन त्रुटि ✅ Correct Answer: 💡 Explanation / व्याख्या Explanation (English) Object not fully constructed; destructor NOT called. Only catch runs. Output: C. व्याख्या (हिन्दी) वस्तु पूर्णतः निर्मित नहीं है; विध्वंसक को नहीं बुलाया गया। केवल रन पकड़ो. आउटपुट: सी. 🎯 Exam Perspective UPSC, SSC, Banking और Police भर्ती जैसी परीक्षाओं में OOP Using C++ ("Exception Handling" sub-topic) से सवाल अक्सर पूछे जाते हैं। इसलिए सिर्फ answer रटने के बजाय, नीचे दी गई explanation को ध्यान से पढ़ें और concept समझें। 🔗 Related Questions What is the output: struct Base{virtual ~Base()=default... What is 'std::terminate' called in situations besides u... What is the output: try{try{throw 1;}catch(int i){throw... 📚 Related Topic Introduction to C++ (187) Variables and Data Types (160) Operators in C++ (163)
27 Question 27 EN + हिं GB What is 'nested exception' in C++? IN C++ में 'नेस्टेड अपवाद' क्या है? A std::nested_exception stores current exception while throwing another std::nested_exception किसी अन्य को फेंकते समय वर्तमान अपवाद को संग्रहीत करता है B Exception inside destructor विध्वंसक के अंदर अपवाद C Recursive exception पुनरावर्ती अपवाद D Exception chain अपवाद शृंखला ✅ Correct Answer: 💡 Explanation / व्याख्या Explanation (English) std::nested_exception and std::throw_with_nested() allow chaining exceptions (like Java's cause). व्याख्या (हिन्दी) std::nested_exception और std::throw_with_nested() चेनिंग अपवादों की अनुमति देते हैं (जैसे जावा का कारण)। 🎯 Exam Perspective अगर आप Railway, SSC, Banking और Defence परीक्षाओं की तैयारी कर रहे हैं, तो OOP Using C++ ("Exception Handling" sub-topic) का यह topic आपके लिए महत्वपूर्ण है। Exam में accuracy बढ़ाने के लिए हर सवाल की explanation जरूर पढ़ें। 🔗 Related Questions What is the output: try{throw std::runtime_error("fail"... What is the output: struct A{A(){throw 1;} ~A(){cout What is 'function-try-block'? 📚 Related Topic Introduction to C++ (187) Variables and Data Types (160) Operators in C++ (163)
28 Question 28 EN + हिं GB What is the output: try{vector v; v.at(5);}catch(out_of_range& e){cout<<'O';}catch(...){cout<<'X';} IN आउटपुट क्या है: प्रयास करें {वेक्टर v; v.at(5);}catch(out_of_range& e){cout A O हे B X एक्स C Undefined अपरिभाषित D Compile error संकलन त्रुटि ✅ Correct Answer: 💡 Explanation / व्याख्या Explanation (English) vector::at() throws std::out_of_range for invalid index. catch(out_of_range) matches. Output: O. व्याख्या (हिन्दी) वेक्टर::at() अमान्य अनुक्रमणिका के लिए std::out_of_range फेंकता है। कैच(आउट_ऑफ_रेंज) मैच। आउटपुट: ओ. 🎯 Exam Perspective OOP Using C++ ("Exception Handling" sub-topic) के इस प्रश्न को कई प्रतियोगी परीक्षाओं जैसे SSC, Railway, Banking और State PCS में repeat होते देखा गया है। Concept clarity के लिए explanation section जरूर पढ़ें। 🔗 Related Questions What is the output: struct A{A(){throw 1;} ~A(){cout What is the output: struct Base{virtual ~Base()=default... What is 'nested exception' in C++? 📚 Related Topic Introduction to C++ (187) Variables and Data Types (160) Operators in C++ (163)
29 Question 29 EN + हिं GB What is the output: int x=0; try{x=1; throw 1; x=2;}catch(int){x=3;} cout< IN आउटपुट क्या है: int x=0; प्रयास करें{x=1; फेंको 1; x=2;}catch(int){x=3;} cout A 3 3 B 1 1 C 2 2 D Undefined अपरिभाषित ✅ Correct Answer: 💡 Explanation / व्याख्या Explanation (English) x=1, throw 1 skips x=2, catch sets x=3. Output: 3. व्याख्या (हिन्दी) x=1, 1 स्किप x=2 फेंकें, कैच सेट x=3। आउटपुट: 3. 🎯 Exam Perspective यह सवाल OOP Using C++ ("Exception Handling" sub-topic) category का है, और SSC CGL, IBPS, RRB और State-level परीक्षाओं के exam pattern में इस तरह के questions common हैं। Answer choose करने के बाद दिया गया explanation जरूर पढ़ें। 🔗 Related Questions What is the output: void f() noexcept(false){throw 1;}... What is the output: try{try{throw 1;}catch(int i){throw... What is 'function-try-block'? 📚 Related Topic Introduction to C++ (187) Variables and Data Types (160) Operators in C++ (163)
30 Question 30 EN + हिं GB What is the output: try{throw 1;}catch(int i){cout< IN आउटपुट क्या है: Try{throw 1;}catch(int i){cout A 1 1 B 2 2 C 12 12 D Compile error संकलन त्रुटि ✅ Correct Answer: 💡 Explanation / व्याख्या Explanation (English) Multiple handlers for the same type after the first is unreachable; some compilers warn/error. This is a compile error. व्याख्या (हिन्दी) पहले के पहुंच से बाहर होने के बाद एक ही प्रकार के लिए एकाधिक हैंडलर; कुछ कंपाइलर्स चेतावनी/त्रुटि देते हैं। यह एक संकलन त्रुटि है. 🎯 Exam Perspective यह प्रश्न OOP Using C++ ("Exception Handling" sub-topic) की तैयारी करने वाले अभ्यर्थियों के लिए उपयोगी है। इस तरह के प्रश्न अक्सर UPSC, SSC, Banking और Police भर्ती जैसी परीक्षाओं में पूछे जाते रहे हैं, इसलिए concept और explanation दोनों को ध्यान से समझें, सिर्फ उत्तर याद न करें। 🔗 Related Questions What is the output: struct A{A(){throw 1;} ~A(){cout What is 'std::terminate' called in situations besides u... What is the output: try{vector v; v.at(5);}catch(out_of... 📚 Related Topic Introduction to C++ (187) Variables and Data Types (160) Operators in C++ (163)