76 Question 76 EN + हिं GB What is the output: try{string s=string(size_t(-1),'x');}catch(bad_alloc&){cout<<'M';}catch(length_error&){cout<<'L';} IN आउटपुट क्या है: Try{string s=string(size_t(-1),'x');}catch( Bad_alloc&){cout A L एल B M एम C Compile error संकलन त्रुटि D Undefined अपरिभाषित ✅ Correct Answer: 💡 Explanation / व्याख्या Explanation (English) size_t(-1) is UINT_MAX — too large; string throws length_error or bad_alloc. Most likely bad_alloc. Output: M. व्याख्या (हिन्दी) size_t(-1) UINT_MAX है - बहुत बड़ा; स्ट्रिंग length_error या Bad_alloc फेंकती है। सबसे अधिक संभावना ख़राब_आवंटन। आउटपुट: एम. 🎯 Exam Perspective OOP Using C++ ("Exception Handling" sub-topic) के इस प्रश्न को कई प्रतियोगी परीक्षाओं जैसे SSC CGL, IBPS, RRB और State-level परीक्षाओं में repeat होते देखा गया है। Concept clarity के लिए explanation section जरूर पढ़ें। 🔗 Related Questions What is the output: try{throw 1;}catch(int i){cout What is the output: try{throw 1;}catch(int i){cout What is the output: class Ex{int c; public:Ex(int v):c(... 📚 Related Topic Introduction to C++ (187) Variables and Data Types (160) Operators in C++ (163)
77 Question 77 EN + हिं GB What is the output: try{stod("3.14");}catch(invalid_argument&){cout<<'I';}catch(...){cout<<'X';} cout< IN आउटपुट क्या है: प्रयास करें {stod ("3.14");} पकड़ें (अमान्य_argument &) {cout A 3.14 3.14 B I मैं C Compile error संकलन त्रुटि D Undefined अपरिभाषित ✅ Correct Answer: 💡 Explanation / व्याख्या Explanation (English) stod("3.14") succeeds; no catch. cout outputs 3.14. Output: 3.14. व्याख्या (हिन्दी) Stod('3.14') सफल होता है; कोई पकड़ नहीं. कॉउट आउटपुट 3.14. आउटपुट: 3.14. 🎯 Exam Perspective यह सवाल OOP Using C++ ("Exception Handling" sub-topic) category का है, और UPSC, SSC, Banking और Police भर्ती के exam pattern में इस तरह के questions common हैं। Answer choose करने के बाद दिया गया explanation जरूर पढ़ें। 🔗 Related Questions What is the output: int n=0; try{for(int i=0;i What is the output: struct RAII{int& r;RAII(int& x):r(x... What is the output: try{throw 1;}catch(int i){cout 📚 Related Topic Introduction to C++ (187) Variables and Data Types (160) Operators in C++ (163)
78 Question 78 EN + हिं GB What is the output: auto safe_div=[](int a,int b)->optional{if(b==0) return nullopt; return a/b;}; auto r=safe_div(10,3); cout<<(r?*r:-1); IN आउटपुट क्या है: autosafe_div=[](int a,int b)-> वैकल्पिक{if(b==0) return nullopt; वापसी ए/बी;}; ऑटो r=safe_div(10,3); अदालत A 3 3 B -1 -1 C Compile error संकलन त्रुटि D Undefined अपरिभाषित ✅ Correct Answer: 💡 Explanation / व्याख्या Explanation (English) b!=0: r=10/3=3. Output: 3. व्याख्या (हिन्दी) बी!=0: आर=10/3=3. आउटपुट: 3. 🎯 Exam Perspective यह प्रश्न OOP Using C++ ("Exception Handling" sub-topic) की तैयारी करने वाले अभ्यर्थियों के लिए उपयोगी है। इस तरह के प्रश्न अक्सर Railway, SSC, Banking और Defence परीक्षाओं जैसी परीक्षाओं में पूछे जाते रहे हैं, इसलिए concept और explanation दोनों को ध्यान से समझें, सिर्फ उत्तर याद न करें। 🔗 Related Questions What is the output: auto ex=make_exception_ptr(runtime_... What is the output: auto f=[]()->expected{return 42;};... What is the output: int n=0; try{for(int i=0;i 📚 Related Topic Introduction to C++ (187) Variables and Data Types (160) Operators in C++ (163)
79 Question 79 EN + हिं GB What is the output: try{throw 1;}catch(int i){cout< IN आउटपुट क्या है: Try{throw 1;}catch(int i){cout A 121 121 B 12 12 C Compile error संकलन त्रुटि D Undefined अपरिभाषित ✅ Correct Answer: 💡 Explanation / व्याख्या Explanation (English) Outer catches 1 (prints 1); inner throws 2, catches (prints 2); then prints i=1 again. Output: 121. व्याख्या (हिन्दी) बाहरी कैच 1 (प्रिंट 1); आंतरिक थ्रो 2, कैच (प्रिंट 2); फिर i=1 फिर से प्रिंट करता है। आउटपुट: 121. 🎯 Exam Perspective OOP Using C++ ("Exception Handling" sub-topic) से जुड़ा यह सवाल उन students के लिए काम का है जो SSC, Railway, Banking और State PCS की तैयारी कर रहे हैं। बेहतर होगा कि explanation पढ़कर concept clear करें, ताकि exam में similar प्रश्न आने पर confusion न हो। 🔗 Related Questions What is the output: try{throw 1;}catch(int i){cout What is the output: try{string s=string(size_t(-1),'x')... What is the output: try{stod("3.14");}catch(invalid_arg... 📚 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 Ex{int c; public:Ex(int v):c(v){} int code()const{return c;}}; try{throw Ex(42);}catch(Ex& e){cout< IN आउटपुट क्या है: class Ex{int c; सार्वजनिक:Ex(int v):c(v){} int कोड()const{return c;}}; प्रयास करें{फेंकें Ex(42);}पकड़ें(Ex& e){cout A 42 42 C Compile error संकलन त्रुटि D Undefined अपरिभाषित ✅ Correct Answer: 💡 Explanation / व्याख्या Explanation (English) e.code()=42. Output: 42. व्याख्या (हिन्दी) ई.कोड()=42. आउटपुट: 42. 🎯 Exam Perspective SSC CGL, IBPS, RRB और State-level परीक्षाओं जैसी परीक्षाओं में OOP Using C++ ("Exception Handling" sub-topic) से सवाल अक्सर पूछे जाते हैं। इसलिए सिर्फ answer रटने के बजाय, नीचे दी गई explanation को ध्यान से पढ़ें और concept समझें। 🔗 Related Questions What is the output: int n=0; try{for(int i=0;i What is the output: void f()noexcept{cout What is the output: auto ex=make_exception_ptr(runtime_... 📚 Related Topic Introduction to C++ (187) Variables and Data Types (160) Operators in C++ (163)
81 Question 81 EN + हिं GB What is the output: int x=0; try{x=1;if(x) throw 'E';x=2;}catch(char c){cout< IN आउटपुट क्या है: int x=0; प्रयास करें{x=1;if(x) फेंक 'ई';x=2;}पकड़ें(char c){cout A E1 ई 1 B E2 ई2 C Compile error संकलन त्रुटि D Undefined अपरिभाषित ✅ Correct Answer: 💡 Explanation / व्याख्या Explanation (English) x=1; throw 'E'; x=2 skipped; catch prints E; cout< व्याख्या (हिन्दी) एक्स=1; 'ई' फेंको; x=2 छोड़ दिया गया; कैच प्रिंट ई; अदालत 🎯 Exam Perspective अगर आप UPSC, SSC, Banking और Police भर्ती की तैयारी कर रहे हैं, तो OOP Using C++ ("Exception Handling" sub-topic) का यह topic आपके लिए महत्वपूर्ण है। Exam में accuracy बढ़ाने के लिए हर सवाल की explanation जरूर पढ़ें। 🔗 Related Questions What is the output: try{stod("3.14");}catch(invalid_arg... What is the output: auto safe_div=[](int a,int b)->opti... What is the output: class Ex{int c; public:Ex(int v):c(... 📚 Related Topic Introduction to C++ (187) Variables and Data Types (160) Operators in C++ (163)
82 Question 82 EN + हिं GB What is the output: struct RAII{int& r;RAII(int& x):r(x){r=1;} ~RAII(){r=0;}}; int x=0; try{RAII g(x); throw 1;}catch(int){cout< IN आउटपुट क्या है: struct RAII{int& r;RAII(int& x):r(x){r=1;} ~RAII(){r=0;}}; int x=0; प्रयास करें{RAII g(x); फेंको 1;}पकड़ो(int){cout B 1 1 C Compile error संकलन त्रुटि D Undefined अपरिभाषित ✅ Correct Answer: 💡 Explanation / व्याख्या Explanation (English) Stack unwind: ~RAII sets x=0. catch: cout< व्याख्या (हिन्दी) स्टैक अनवाइंड: ~RAII x=0 सेट करता है। पकड़ो: कोउट 🎯 Exam Perspective OOP Using C++ ("Exception Handling" sub-topic) के इस प्रश्न को कई प्रतियोगी परीक्षाओं जैसे Railway, SSC, Banking और Defence परीक्षाओं में repeat होते देखा गया है। Concept clarity के लिए explanation section जरूर पढ़ें। 🔗 Related Questions What is the output: int x=0; try{x=1;if(x) throw 'E';x=... What is the output: try{try{throw runtime_error("err");... What is the output: auto f=[]()->expected{return 42;};... 📚 Related Topic Introduction to C++ (187) Variables and Data Types (160) Operators in C++ (163)
83 Question 83 EN + हिं GB What is the output: try{try{throw runtime_error("err");}catch(logic_error&){cout<<'L';}}catch(runtime_error&e){cout< IN आउटपुट क्या है: प्रयास करें {कोशिश करें {थ्रो रनटाइम_एरर ("इर्रर");}कैच (लॉजिक_एरर और) {काउट A err ग़लती होना B L एल C Compile error संकलन त्रुटि D Undefined अपरिभाषित ✅ Correct Answer: 💡 Explanation / व्याख्या Explanation (English) Inner doesn't match; propagates to outer: err. Output: err. व्याख्या (हिन्दी) भीतरी मेल नहीं खाता; बाहरी तक फैलता है: err. आउटपुट: ग़लती। 🎯 Exam Perspective यह सवाल OOP Using C++ ("Exception Handling" sub-topic) category का है, और SSC, Railway, Banking और State PCS के exam pattern में इस तरह के questions common हैं। Answer choose करने के बाद दिया गया explanation जरूर पढ़ें। 🔗 Related Questions What is the output: try{throw 1;}catch(int i){cout What is the output: struct RAII{int& r;RAII(int& x):r(x... What is the output: try{stod("3.14");}catch(invalid_arg... 📚 Related Topic Introduction to C++ (187) Variables and Data Types (160) Operators in C++ (163)
84 Question 84 EN + हिं GB What is the output: auto f=[]()->expected{return 42;}; auto g=[]()->expected{return unexpected("fail");}; cout< IN आउटपुट क्या है: auto f=[]()->expected{return 42;}; ऑटो g=[]()->अपेक्षित{वापसी अप्रत्याशित('असफल');}; अदालत A 420 420 B Compile error संकलन त्रुटि C Undefined अपरिभाषित D 42 0 42 0 ✅ Correct Answer: 💡 Explanation / व्याख्या Explanation (English) f()=42; g() has no value. Output: 420. व्याख्या (हिन्दी) एफ()=42; g() का कोई मूल्य नहीं है। आउटपुट: 420. 🎯 Exam Perspective यह प्रश्न OOP Using C++ ("Exception Handling" sub-topic) की तैयारी करने वाले अभ्यर्थियों के लिए उपयोगी है। इस तरह के प्रश्न अक्सर SSC CGL, IBPS, RRB और State-level परीक्षाओं जैसी परीक्षाओं में पूछे जाते रहे हैं, इसलिए concept और explanation दोनों को ध्यान से समझें, सिर्फ उत्तर याद न करें। 🔗 Related Questions What is the output: void f()noexcept{cout What is the output: auto ex=make_exception_ptr(runtime_... What is the output: try{throw 1;}catch(int i){cout 📚 Related Topic Introduction to C++ (187) Variables and Data Types (160) Operators in C++ (163)
85 Question 85 EN + हिं GB What is the output: int n=0; try{for(int i=0;i<5;i++){n++; if(i==2) throw i;}}catch(int i){cout< IN आउटपुट क्या है: int n=0; प्रयास करें{for(int i=0;i A 33 33 B 32 32 C Compile error संकलन त्रुटि D Undefined अपरिभाषित ✅ Correct Answer: 💡 Explanation / व्याख्या Explanation (English) i=0:n=1;i=1:n=2;i=2:n=3,throw 2. catch: cout<<3<<2. Output: 32. व्याख्या (हिन्दी) i=0:n=1;i=1:n=2;i=2:n=3,थ्रो 2. कैच: कॉउट 🎯 Exam Perspective OOP Using C++ ("Exception Handling" sub-topic) से जुड़ा यह सवाल उन students के लिए काम का है जो UPSC, SSC, Banking और Police भर्ती की तैयारी कर रहे हैं। बेहतर होगा कि explanation पढ़कर concept clear करें, ताकि exam में similar प्रश्न आने पर confusion न हो। 🔗 Related Questions What is the output: class Ex{int c; public:Ex(int v):c(... What is the output: try{int x=stoi("2147483648");}catch... What is the output: class A{public:~A()noexcept(false){... 📚 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:~A()noexcept(false){throw 1;}}; try{A a;}catch(...){cout<<'X';} IN आउटपुट क्या है: वर्ग A{सार्वजनिक:~A()noexcept(false){throw 1;}}; प्रयास करें{ए ए;}पकड़ो(...){कोउट A X एक्स B std::terminate एसटीडी::समाप्त C Compile error संकलन त्रुटि D Undefined अपरिभाषित ✅ Correct Answer: 💡 Explanation / व्याख्या Explanation (English) Destructor throws; no active exception: std::terminate called. Output: terminate. व्याख्या (हिन्दी) विध्वंसक फेंकता है; कोई सक्रिय अपवाद नहीं: std::terminet कहा गया। आउटपुट: समाप्त करें. 🎯 Exam Perspective Railway, SSC, Banking और Defence परीक्षाओं जैसी परीक्षाओं में OOP Using C++ ("Exception Handling" sub-topic) से सवाल अक्सर पूछे जाते हैं। इसलिए सिर्फ answer रटने के बजाय, नीचे दी गई explanation को ध्यान से पढ़ें और concept समझें। 🔗 Related Questions What is the output: try{try{throw runtime_error("err");... What is the output: try{throw 1;}catch(int i){cout What is the output: int n=0; try{for(int i=0;i 📚 Related Topic Introduction to C++ (187) Variables and Data Types (160) Operators in C++ (163)
87 Question 87 EN + हिं GB What is the output: void f()noexcept{cout<<1;} void g(){try{f();}catch(...){cout<<2;}} g(); IN आउटपुट क्या है: void f()noexcept{cout A 1 1 B 12 12 C Compile error संकलन त्रुटि D Undefined अपरिभाषित ✅ Correct Answer: 💡 Explanation / व्याख्या Explanation (English) f() doesn't throw; catch not entered. Output: 1. व्याख्या (हिन्दी) f() फेंकता नहीं है; कैच दर्ज नहीं किया गया. आउटपुट: 1. 🎯 Exam Perspective अगर आप SSC, Railway, Banking और State PCS की तैयारी कर रहे हैं, तो OOP Using C++ ("Exception Handling" sub-topic) का यह topic आपके लिए महत्वपूर्ण है। Exam में accuracy बढ़ाने के लिए हर सवाल की explanation जरूर पढ़ें। 🔗 Related Questions What is the output: try{int x=stoi("2147483648");}catch... What is the output: auto ex=make_exception_ptr(runtime_... What is the output: int x=0; try{x=1;if(x) throw 'E';x=... 📚 Related Topic Introduction to C++ (187) Variables and Data Types (160) Operators in C++ (163)
88 Question 88 EN + हिं GB What is the output: try{int x=stoi("2147483648");}catch(out_of_range&){cout<<'O';} IN आउटपुट क्या है: Try{int x=stoi('2147483648');}catch(out_of_range&){cout A O हे B Compile error संकलन त्रुटि C Undefined अपरिभाषित D 2147483648 2147483648 ✅ Correct Answer: 💡 Explanation / व्याख्या Explanation (English) 2147483648 > INT_MAX: stoi throws out_of_range. Output: O. व्याख्या (हिन्दी) 2147483648 > INT_MAX: Stoi आउट_ऑफ़_रेंज फेंकता है। आउटपुट: ओ. 🎯 Exam Perspective OOP Using C++ ("Exception Handling" sub-topic) के इस प्रश्न को कई प्रतियोगी परीक्षाओं जैसे SSC CGL, IBPS, RRB और State-level परीक्षाओं में repeat होते देखा गया है। Concept clarity के लिए explanation section जरूर पढ़ें। 🔗 Related Questions What is the output: try{throw 1;}catch(int i){cout What is the output: class A{public:~A()noexcept(false){... What is the output: int x=0; try{x=1;if(x) throw 'E';x=... 📚 Related Topic Introduction to C++ (187) Variables and Data Types (160) Operators in C++ (163)
89 Question 89 EN + हिं GB What is the output: try{throw 1;}catch(int i){cout< IN आउटपुट क्या है: प्रयास करें {थ्रो 1;} कैच (इंट आई) {काउट A 1 1 B 12 12 C std::terminate एसटीडी::समाप्त D Compile error संकलन त्रुटि ✅ Correct Answer: 💡 Explanation / व्याख्या Explanation (English) throw i+1 propagates outside the try-catch; no outer handler: terminate. Output: 1 then terminate. व्याख्या (हिन्दी) थ्रो i+1 ट्राई-कैच के बाहर प्रचारित होता है; कोई बाहरी हैंडलर नहीं: समाप्त करें। आउटपुट: 1 फिर समाप्त करें। 🎯 Exam Perspective यह सवाल OOP Using C++ ("Exception Handling" sub-topic) category का है, और UPSC, SSC, Banking और Police भर्ती के exam pattern में इस तरह के questions common हैं। Answer choose करने के बाद दिया गया explanation जरूर पढ़ें। 🔗 Related Questions What is the output: auto f=[]()->expected{return 42;};... What is the output: void f()noexcept{cout What is the output: class Ex{int c; public:Ex(int v):c(... 📚 Related Topic Introduction to C++ (187) Variables and Data Types (160) Operators in C++ (163)
90 Question 90 EN + हिं GB What is the output: auto ex=make_exception_ptr(runtime_error("err")); try{rethrow_exception(ex);}catch(runtime_error& e){cout< IN आउटपुट क्या है: auto ex=make_exception_ptr(runtime_error("err")); प्रयास करें{rethrow_exception(ex);}catch(runtime_error& e){cout A err ग़लती होना B Compile error संकलन त्रुटि C Undefined अपरिभाषित D Nothing कुछ नहीं ✅ Correct Answer: 💡 Explanation / व्याख्या Explanation (English) rethrow_exception throws stored exception. Caught: err. Output: err. व्याख्या (हिन्दी) rethrow_exception संग्रहीत अपवाद को फेंकता है। पकड़ा गया: ग़लती. आउटपुट: ग़लती। 🎯 Exam Perspective यह प्रश्न OOP Using C++ ("Exception Handling" sub-topic) की तैयारी करने वाले अभ्यर्थियों के लिए उपयोगी है। इस तरह के प्रश्न अक्सर Railway, SSC, Banking और Defence परीक्षाओं जैसी परीक्षाओं में पूछे जाते रहे हैं, इसलिए concept और explanation दोनों को ध्यान से समझें, सिर्फ उत्तर याद न करें। 🔗 Related Questions What is the output: try{stod("3.14");}catch(invalid_arg... What is the output: struct RAII{int& r;RAII(int& x):r(x... What is the output: try{try{throw runtime_error("err");... 📚 Related Topic Introduction to C++ (187) Variables and Data Types (160) Operators in C++ (163)