1 Question 1 EN + हिं GB What is the output: try{throw 42;}catch(int i){cout< IN आउटपुट क्या है: Try{throw 42;}catch(int i){cout A 42 42 C Compile error संकलन त्रुटि D Undefined अपरिभाषित ✅ Correct Answer: 💡 Explanation / व्याख्या Explanation (English) throw 42 throws int; catch(int i) catches it; prints 42. व्याख्या (हिन्दी) थ्रो 42 थ्रो इंट; पकड़ (int i) इसे पकड़ता है; प्रिंट 42. 🎯 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 'std::exception_ptr'? What is 'catch-all' handler in C++? What is the output: void f(){throw string("Error");} tr... 📚 Related Topic Introduction to C++ (187) Variables and Data Types (160) Operators in C++ (163)
2 Question 2 EN + हिं GB What happens when no catch handler matches a thrown exception? IN क्या होता है जब कोई कैच हैंडलर फेंके गए अपवाद से मेल नहीं खाता? A Program continues कार्यक्रम जारी है B std::terminate is called std::terminet कहा जाता है C Exception is silently ignored अपवाद को चुपचाप नजरअंदाज कर दिया जाता है D Default catch is used डिफ़ॉल्ट कैच का उपयोग किया जाता है ✅ Correct Answer: 💡 Explanation / व्याख्या Explanation (English) If no handler matches (and no catch-all ...), std::terminate() is called, ending the program. व्याख्या (हिन्दी) यदि कोई हैंडलर मेल नहीं खाता (और कोई कैच-ऑल नहीं...), तो std::terminet() को कॉल किया जाता है, जिससे प्रोग्राम समाप्त हो जाता है। 🎯 Exam Perspective UPSC, SSC, Banking और Police भर्ती जैसी परीक्षाओं में OOP Using C++ ("Exception Handling" sub-topic) से सवाल अक्सर पूछे जाते हैं। इसलिए सिर्फ answer रटने के बजाय, नीचे दी गई explanation को ध्यान से पढ़ें और concept समझें। 🔗 Related Questions What is the output: try{throw;}catch(int){cout What is the output: try{int*p=nullptr; *p=1;}catch(runt... What is the output: auto f=[]()noexcept{throw 1;}; try{... 📚 Related Topic Introduction to C++ (187) Variables and Data Types (160) Operators in C++ (163)
3 Question 3 EN + हिं GB What is the output: try{try{throw 1.0;}catch(int){cout<<'I';}}catch(double){cout<<'D';} IN आउटपुट क्या है: प्रयास करें {प्रयास करें {थ्रो 1.0;} पकड़ें (int) {काउट A I मैं B D डी C ID पहचान D Compile error संकलन त्रुटि ✅ Correct Answer: 💡 Explanation / व्याख्या Explanation (English) 1.0 is double; inner catch(int) doesn't match; propagates to outer catch(double). Output: D. व्याख्या (हिन्दी) 1.0 दोगुना है; आंतरिक कैच(इंट) मेल नहीं खाता; बाहरी कैच (डबल) तक फैलता है। आउटपुट: डी. 🎯 Exam Perspective अगर आप Railway, SSC, Banking और Defence परीक्षाओं की तैयारी कर रहे हैं, तो OOP Using C++ ("Exception Handling" sub-topic) का यह topic आपके लिए महत्वपूर्ण है। Exam में accuracy बढ़ाने के लिए हर सवाल की explanation जरूर पढ़ें। 🔗 Related Questions What is 'stack unwinding'? What is 'exception specification' in C++? What is 'exception safety guarantee'? 📚 Related Topic Introduction to C++ (187) Variables and Data Types (160) Operators in C++ (163)
4 Question 4 EN + हिं GB What is 'exception safety guarantee'? IN 'अपवाद सुरक्षा गारंटी' क्या है? A Level of guarantee a function provides about state when exception thrown अपवाद फेंके जाने पर कोई फ़ंक्शन स्थिति के बारे में गारंटी का स्तर प्रदान करता है B Catching all exceptions सभी अपवादों को पकड़ना C noexcept specification विशिष्टता को छोड़कर कोई नहीं D Stack unwinding ढेर खोलना ✅ Correct Answer: 💡 Explanation / व्याख्या Explanation (English) Levels: basic (no leak), strong (transaction), nothrow (never throws). Exception safety is about invariant preservation. व्याख्या (हिन्दी) स्तर: बुनियादी (कोई रिसाव नहीं), मजबूत (लेन-देन), नोथ्रो (कभी नहीं फेंकता)। अपवाद सुरक्षा अपरिवर्तनीय संरक्षण के बारे में है। 🎯 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){i=99; co... What is the output: struct A{~A(){cout What happens when no catch handler matches a thrown exc... 📚 Related Topic Introduction to C++ (187) Variables and Data Types (160) Operators in C++ (163)
5 Question 5 EN + हिं GB What is the output: struct A{~A(){cout<<'D';}}; try{A a; throw 1;}catch(int){cout<<'C';} IN आउटपुट क्या है: struct A{~A(){cout A CD सीडी B DC डीसी C C सी D Compile error संकलन त्रुटि ✅ Correct Answer: 💡 Explanation / व्याख्या Explanation (English) Stack unwinding destroys a (prints D) before catch handler executes (prints C). Output: DC. व्याख्या (हिन्दी) कैच हैंडलर निष्पादित (प्रिंट सी) से पहले स्टैक अनवाइंडिंग (प्रिंट डी) को नष्ट कर देता है। आउटपुट: डीसी. 🎯 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 'std::exception_ptr'? What is the output: try{throw 1;}catch(int& i){i=99; co... What is the output: try{throw;}catch(int){cout 📚 Related Topic Introduction to C++ (187) Variables and Data Types (160) Operators in C++ (163)
6 Question 6 EN + हिं GB What is the output: try{throw;}catch(int){cout<<'I';}catch(...){cout<<'A';} IN आउटपुट क्या है: प्रयास करें {फेंकें;} पकड़ें (int) {काउट A A ए B I मैं C std::terminate एसटीडी::समाप्त D Compile error संकलन त्रुटि ✅ Correct Answer: 💡 Explanation / व्याख्या Explanation (English) throw; with no active exception calls std::terminate(). व्याख्या (हिन्दी) फेंक; बिना किसी सक्रिय अपवाद के std::termine() कॉल करता है। 🎯 Exam Perspective यह प्रश्न OOP Using C++ ("Exception Handling" sub-topic) की तैयारी करने वाले अभ्यर्थियों के लिए उपयोगी है। इस तरह के प्रश्न अक्सर UPSC, SSC, Banking और Police भर्ती जैसी परीक्षाओं में पूछे जाते रहे हैं, इसलिए concept और explanation दोनों को ध्यान से समझें, सिर्फ उत्तर याद न करें। 🔗 Related Questions What is 'stack unwinding'? What is 'std::exception_ptr'? What is the output: struct A{~A(){cout 📚 Related Topic Introduction to C++ (187) Variables and Data Types (160) Operators in C++ (163)
7 Question 7 EN + हिं GB What is 'catch-all' handler in C++? IN C++ में 'कैच-ऑल' हैंडलर क्या है? A catch(...) — catches any exception type पकड़ो(...) - किसी भी अपवाद प्रकार को पकड़ता है B catch(void) पकड़ना(शून्य) C catch(exception) पकड़ो (अपवाद) D Catching by value मूल्य के आधार पर पकड़ना ✅ Correct Answer: 💡 Explanation / व्याख्या Explanation (English) catch(...) catches any exception type including non-class exceptions. व्याख्या (हिन्दी) कैच(...) गैर-वर्ग अपवादों सहित किसी भी अपवाद प्रकार को पकड़ता है। 🎯 Exam Perspective OOP Using C++ ("Exception Handling" sub-topic) से जुड़ा यह सवाल उन students के लिए काम का है जो Railway, SSC, Banking और Defence परीक्षाओं की तैयारी कर रहे हैं। बेहतर होगा कि explanation पढ़कर concept clear करें, ताकि exam में similar प्रश्न आने पर confusion न हो। 🔗 Related Questions What is the output: try{throw 1;}catch(int& i){i=99; co... What is the output: struct A{~A(){cout What is 'stack unwinding'? 📚 Related Topic Introduction to C++ (187) Variables and Data Types (160) Operators in C++ (163)
8 Question 8 EN + हिं GB What is the output: void f(){throw string("Error");} try{f();}catch(const string& s){cout< IN आउटपुट क्या है: void f(){throw string("Error");} Try{f();}catch(const string& s){cout A Error गलती B Compile error संकलन त्रुटि C Undefined अपरिभाषित D Nothing कुछ नहीं ✅ Correct Answer: 💡 Explanation / व्याख्या Explanation (English) f() throws string. catch catches by const ref, prints Error. Output: Error. व्याख्या (हिन्दी) f() स्ट्रिंग फेंकता है। कॉन्स्ट रेफरी द्वारा कैच पकड़ें, त्रुटि प्रिंट करें। आउटपुट: त्रुटि. 🎯 Exam Perspective SSC, Railway, Banking और State PCS जैसी परीक्षाओं में OOP Using C++ ("Exception Handling" sub-topic) से सवाल अक्सर पूछे जाते हैं। इसलिए सिर्फ answer रटने के बजाय, नीचे दी गई explanation को ध्यान से पढ़ें और concept समझें। 🔗 Related Questions What is 'catch-all' handler in C++? What is the output: try{int*p=nullptr; *p=1;}catch(runt... What is the output: try{throw 42;}catch(int i){cout 📚 Related Topic Introduction to C++ (187) Variables and Data Types (160) Operators in C++ (163)
9 Question 9 EN + हिं GB What is 'stack unwinding'? IN 'स्टैक अनवाइंडिंग' क्या है? A Destructors called for local objects as exception propagates अपवाद प्रसार के रूप में विध्वंसकों ने स्थानीय वस्तुओं को बुलाया B Recursive function termination पुनरावर्ती कार्य समाप्ति C Stack overflow handling स्टैक ओवरफ्लो प्रबंधन D Memory deallocation मेमोरी डिलोकेशन ✅ Correct Answer: 💡 Explanation / व्याख्या Explanation (English) Stack unwinding: as exception propagates, destructors are called for all local objects in the chain of scopes. व्याख्या (हिन्दी) स्टैक अनवाइंडिंग: जैसे-जैसे अपवाद फैलता है, स्कोप की श्रृंखला में सभी स्थानीय वस्तुओं के लिए डिस्ट्रक्टर्स को बुलाया जाता है। 🎯 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: struct A{~A(){cout What is the output: try{try{throw 1.0;}catch(int){cout What is the output: auto f=[]()noexcept{throw 1;}; try{... 📚 Related Topic Introduction to C++ (187) Variables and Data Types (160) Operators in C++ (163)
10 Question 10 EN + हिं GB What is the output: class E{public: string msg; E(string s):msg(s){}}; try{throw E("Oops");}catch(E& e){cout< IN आउटपुट क्या है: वर्ग ई {सार्वजनिक: स्ट्रिंग संदेश; ई(स्ट्रिंग s):msg(s){}}; प्रयास करें{फेंकें E("उफ़");}पकड़ें(E& e){cout A Oops उफ़ B E ई C Compile error संकलन त्रुटि D Undefined अपरिभाषित ✅ Correct Answer: 💡 Explanation / व्याख्या Explanation (English) E(Oops) thrown and caught by reference. e.msg=Oops. Output: Oops. व्याख्या (हिन्दी) ई(उफ़) संदर्भ द्वारा फेंका और पकड़ा गया। e.msg=उफ़. आउटपुट: उफ़. 🎯 Exam Perspective OOP Using C++ ("Exception Handling" sub-topic) के इस प्रश्न को कई प्रतियोगी परीक्षाओं जैसे UPSC, SSC, Banking और Police भर्ती में repeat होते देखा गया है। Concept clarity के लिए explanation section जरूर पढ़ें। 🔗 Related Questions What is the output: try{try{throw 1.0;}catch(int){cout What is the output: try{int*p=nullptr; *p=1;}catch(runt... What is the output: try{throw;}catch(int){cout 📚 Related Topic Introduction to C++ (187) Variables and Data Types (160) Operators in C++ (163)
11 Question 11 EN + हिं GB What is the output: try{throw 1;}catch(int& i){i=99; cout< IN आउटपुट क्या है: Try{throw 1;}catch(int& i){i=99; अदालत A 99 99 B 1 1 C Undefined अपरिभाषित D Compile error संकलन त्रुटि ✅ Correct Answer: 💡 Explanation / व्याख्या Explanation (English) catch by reference; modify i=99; print i=99. Output: 99. व्याख्या (हिन्दी) संदर्भ द्वारा पकड़ें; संशोधित करें i=99; i=99 प्रिंट करें। आउटपुट: 99. 🎯 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: class E{public: string msg; E(strin... What is the output: try{throw 42;}catch(int i){cout What is 'catch-all' handler in C++? 📚 Related Topic Introduction to C++ (187) Variables and Data Types (160) Operators in C++ (163)
12 Question 12 EN + हिं GB What is 'exception specification' in C++? IN C++ में 'अपवाद विशिष्टता' क्या है? A noexcept or noexcept(expr) declaring function won't throw noexcept या noexcept(expr) घोषित करने वाला फ़ंक्शन नहीं फेंकेगा B throw() specification (deprecated) फेंक() विशिष्टता (अप्रत्याशित) C Try-catch inside function फ़ंक्शन के अंदर पकड़ने का प्रयास करें D Exception class hierarchy अपवाद वर्ग पदानुक्रम ✅ Correct Answer: 💡 Explanation / व्याख्या Explanation (English) noexcept specifier (C++11) declares a function doesn't throw; violations call terminate(). व्याख्या (हिन्दी) noexcept विनिर्देशक (C++11) घोषित करता है कि कोई फ़ंक्शन फेंकता नहीं है; उल्लंघन कॉल समाप्त()। 🎯 Exam Perspective यह प्रश्न OOP Using C++ ("Exception Handling" sub-topic) की तैयारी करने वाले अभ्यर्थियों के लिए उपयोगी है। इस तरह के प्रश्न अक्सर SSC, Railway, Banking और State PCS जैसी परीक्षाओं में पूछे जाते रहे हैं, इसलिए concept और explanation दोनों को ध्यान से समझें, सिर्फ उत्तर याद न करें। 🔗 Related Questions What is 'catch-all' handler in C++? What is 'stack unwinding'? What is the output: class E{public: string msg; E(strin... 📚 Related Topic Introduction to C++ (187) Variables and Data Types (160) Operators in C++ (163)
13 Question 13 EN + हिं GB What is the output: auto f=[]()noexcept{throw 1;}; try{f();}catch(...){cout<<'C';} IN आउटपुट क्या है: auto f=[]()noexcept{throw 1;}; प्रयास करें{f();}पकड़ो(...){cout A C सी B std::terminate called std::समाप्त बुलाया गया C Compile error संकलन त्रुटि D Undefined अपरिभाषित ✅ Correct Answer: 💡 Explanation / व्याख्या Explanation (English) noexcept function throwing calls std::terminate, not caught by catch. व्याख्या (हिन्दी) noexcept फ़ंक्शन थ्रोइंग कॉल std::समाप्त, कैच द्वारा नहीं पकड़ा गया। 🎯 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 'std::exception_ptr'? What is the output: struct A{~A(){cout What is the output: try{throw 1;}catch(int& i){i=99; co... 📚 Related Topic Introduction to C++ (187) Variables and Data Types (160) Operators in C++ (163)
14 Question 14 EN + हिं GB What is 'std::exception_ptr'? IN 'std::exception_ptr' क्या है? A Pointer-like type that can store and rethrow exceptions पॉइंटर जैसा प्रकार जो अपवादों को संग्रहीत और पुनर्स्थापित कर सकता है B Base class for all exceptions सभी अपवादों के लिए बेस क्लास C Exception handling overhead ओवरहेड अपवाद हैंडलिंग D Stack pointer during exception अपवाद के दौरान स्टैक सूचक ✅ Correct Answer: 💡 Explanation / व्याख्या Explanation (English) std::exception_ptr enables storing and rethrowing exceptions across threads or callbacks. व्याख्या (हिन्दी) std::exception_ptr थ्रेड या कॉलबैक में अपवादों को संग्रहीत करने और पुनर्स्थापित करने में सक्षम बनाता है। 🎯 Exam Perspective UPSC, SSC, Banking और Police भर्ती जैसी परीक्षाओं में OOP Using C++ ("Exception Handling" sub-topic) से सवाल अक्सर पूछे जाते हैं। इसलिए सिर्फ answer रटने के बजाय, नीचे दी गई explanation को ध्यान से पढ़ें और concept समझें। 🔗 Related Questions What is the output: try{throw 42;}catch(int i){cout What is 'stack unwinding'? What is 'catch-all' handler in C++? 📚 Related Topic Introduction to C++ (187) Variables and Data Types (160) Operators in C++ (163)
15 Question 15 EN + हिं GB What is the output: try{int*p=nullptr; *p=1;}catch(runtime_error& e){cout<<'R';}catch(...){cout<<'A';} IN आउटपुट क्या है: Try{int*p=nullptr; *p=1;}catch(runtime_error& e){cout A R आर B A ए C std::terminate एसटीडी::समाप्त D Undefined behavior (no exception) अपरिभाषित व्यवहार (कोई अपवाद नहीं) ✅ Correct Answer: 💡 Explanation / व्याख्या Explanation (English) Dereferencing null pointer is undefined behavior; it does NOT throw a C++ exception — it likely causes a crash/signal. व्याख्या (हिन्दी) अशक्त सूचक को संदर्भित करना अपरिभाषित व्यवहार है; यह C++ अपवाद नहीं फेंकता - यह संभावित रूप से क्रैश/सिग्नल का कारण बनता है। 🎯 Exam Perspective अगर आप Railway, SSC, Banking और Defence परीक्षाओं की तैयारी कर रहे हैं, तो OOP Using C++ ("Exception Handling" sub-topic) का यह topic आपके लिए महत्वपूर्ण है। Exam में accuracy बढ़ाने के लिए हर सवाल की explanation जरूर पढ़ें। 🔗 Related Questions What is the output: class E{public: string msg; E(strin... What is the output: void f(){throw string("Error");} tr... What is 'exception safety guarantee'? 📚 Related Topic Introduction to C++ (187) Variables and Data Types (160) Operators in C++ (163)