136 Question 136 EN + हिं GB What is the output: auto add=[](int a,int b){return a+b;}; cout< IN आउटपुट क्या है: auto add=[](int a,int b){return a+b;}; अदालत A 7 7 B 34 34 C Compile error संकलन त्रुटि D Undefined अपरिभाषित ✅ Correct Answer: 💡 Explanation / व्याख्या Explanation (English) Lambda with two int parameters returns their sum. add(3,4)=7. व्याख्या (हिन्दी) लैम्ब्डा दो पूर्णांक मापदंडों के साथ उनका योग लौटाता है। जोड़ें(3,4)=7. 🎯 Exam Perspective OOP Using C++ के इस प्रश्न को कई प्रतियोगी परीक्षाओं जैसे Railway, SSC, Banking और Defence परीक्षाओं में repeat होते देखा गया है। Concept clarity के लिए explanation section जरूर पढ़ें। 🔗 Related Questions What is the output: auto f=[](auto x){ return x*2; }; c... What is 'perfect forwarding' in C++? What is a 'variadic template' in C++? 📚 Related Topic Introduction to C++ (187) Variables and Data Types (160) Operators in C++ (163)
137 Question 137 EN + हिं GB What is the difference between pass-by-value and pass-by-reference? IN पास-बाय-वैल्यू और पास-बाय-रेफरेंस के बीच क्या अंतर है? A No difference कोई फर्क नहीं B Pass-by-value copies; pass-by-reference accesses original पास-बाय-वैल्यू प्रतियां; पास-दर-संदर्भ मूल तक पहुँचता है C Pass-by-reference copies पास-दर-संदर्भ प्रतियां D Pass-by-value is faster always पास-बाय-वैल्यू हमेशा तेज़ होता है ✅ Correct Answer: 💡 Explanation / व्याख्या Explanation (English) Pass-by-value creates a copy of the argument; pass-by-reference allows the function to access and modify the original. व्याख्या (हिन्दी) पास-बाय-वैल्यू तर्क की एक प्रति बनाता है; पास-बाय-रेफरेंस फ़ंक्शन को मूल तक पहुंचने और संशोधित करने की अनुमति देता है। 🎯 Exam Perspective यह सवाल OOP Using C++ category का है, और SSC, Railway, Banking और State PCS के exam pattern में इस तरह के questions common हैं। Answer choose करने के बाद दिया गया explanation जरूर पढ़ें। 🔗 Related Questions What is 'SFINAE' in C++? What is the output: auto add=[](int a,int b){return a+b... What is the output: int f(int n){ if(n==0) return 0; re... 📚 Related Topic Introduction to C++ (187) Variables and Data Types (160) Operators in C++ (163)
138 Question 138 EN + हिं GB What is the output: int f(int n){ return n<=1?1:n*f(n-1); } cout< IN आउटपुट क्या है: int f(int n){ return n A 120 120 B 24 24 C 60 60 D Undefined अपरिभाषित ✅ Correct Answer: 💡 Explanation / व्याख्या Explanation (English) Recursive factorial: 5*4*3*2*1=120. व्याख्या (हिन्दी) पुनरावर्ती तथ्यात्मक: 5*4*3*2*1=120। 🎯 Exam Perspective यह प्रश्न OOP Using C++ की तैयारी करने वाले अभ्यर्थियों के लिए उपयोगी है। इस तरह के प्रश्न अक्सर SSC CGL, IBPS, RRB और State-level परीक्षाओं जैसी परीक्षाओं में पूछे जाते रहे हैं, इसलिए concept और explanation दोनों को ध्यान से समझें, सिर्फ उत्तर याद न करें। 🔗 Related Questions What is the output: int f(int x){ return x*2; } int(*fp... What is the output: int f(int& a, int b){ a=10; return... What is the difference between pass-by-value and pass-b... 📚 Related Topic Introduction to C++ (187) Variables and Data Types (160) Operators in C++ (163)
139 Question 139 EN + हिं GB What is 'SFINAE' in C++? IN C++ में 'SFINAE' क्या है? A Substitution Failure Is Not An Error प्रतिस्थापन विफलता कोई त्रुटि नहीं है B Standard Function Inline And Evaluate मानक फ़ंक्शन इनलाइन और मूल्यांकन करें C Special Function Implementation Not Allowed Elsewhere अन्यत्र विशेष कार्य कार्यान्वयन की अनुमति नहीं है D Static Function Initialization And Execution स्थैतिक फ़ंक्शन आरंभीकरण और निष्पादन ✅ Correct Answer: 💡 Explanation / व्याख्या Explanation (English) SFINAE: when template argument substitution fails, the template is removed from overload set rather than causing a compile error. व्याख्या (हिन्दी) SFINAE: जब टेम्पलेट तर्क प्रतिस्थापन विफल हो जाता है, तो संकलन त्रुटि उत्पन्न करने के बजाय टेम्पलेट को ओवरलोड सेट से हटा दिया जाता है। 🎯 Exam Perspective OOP Using C++ से जुड़ा यह सवाल उन students के लिए काम का है जो UPSC, SSC, Banking और Police भर्ती की तैयारी कर रहे हैं। बेहतर होगा कि explanation पढ़कर concept clear करें, ताकि exam में similar प्रश्न आने पर confusion न हो। 🔗 Related Questions What is a 'variadic template' in C++? What is the output: void f(int x){ x=100; } int a=5; f(... What is the output: int f(){ return 1; } int g(){ retur... 📚 Related Topic Introduction to C++ (187) Variables and Data Types (160) Operators in C++ (163)
140 Question 140 EN + हिं GB What is the output: void f(int x){ cout< IN आउटपुट क्या है: void f(int x){ cout A 1 1 B 1.0 1.0 C Ambiguous call अस्पष्ट कॉल D Compile error संकलन त्रुटि ✅ Correct Answer: 💡 Explanation / व्याख्या Explanation (English) float argument: float->double is better conversion than float->int. So f(double) is called, prints 1. व्याख्या (हिन्दी) फ्लोट तर्क: फ्लोट->डबल फ्लोट->इंट की तुलना में बेहतर रूपांतरण है। तो f(double) कहा जाता है, प्रिंट 1। 🎯 Exam Perspective Railway, SSC, Banking और Defence परीक्षाओं जैसी परीक्षाओं में OOP Using C++ से सवाल अक्सर पूछे जाते हैं। इसलिए सिर्फ answer रटने के बजाय, नीचे दी गई explanation को ध्यान से पढ़ें और concept समझें। 🔗 Related Questions What is the output: auto add=[](int a,int b){return a+b... What is a 'variadic template' in C++? What is 'SFINAE' in C++? 📚 Related Topic Introduction to C++ (187) Variables and Data Types (160) Operators in C++ (163)
141 Question 141 EN + हिं GB What is the output: int f(int n){ if(n==0) return 0; return f(n-1)+1; } cout< IN आउटपुट क्या है: int f(int n){ if(n==0) return 0; वापसी f(n-1)+1; } कोउट A 5 5 C 4 4 D Undefined अपरिभाषित ✅ Correct Answer: 💡 Explanation / व्याख्या Explanation (English) Each call adds 1 to result of f(n-1). f(5)=f(4)+1=...=f(0)+5=0+5=5. व्याख्या (हिन्दी) प्रत्येक कॉल f(n-1) के परिणाम में 1 जोड़ती है। f(5)=f(4)+1=...=f(0)+5=0+5=5. 🎯 Exam Perspective अगर आप SSC, Railway, Banking और State PCS की तैयारी कर रहे हैं, तो OOP Using C++ का यह topic आपके लिए महत्वपूर्ण है। Exam में accuracy बढ़ाने के लिए हर सवाल की explanation जरूर पढ़ें। 🔗 Related Questions What is the output: void f(int x){ cout What is the difference between pass-by-value and pass-b... What is the output: int f(int n){ return n 📚 Related Topic Introduction to C++ (187) Variables and Data Types (160) Operators in C++ (163)
142 Question 142 EN + हिं GB What is a 'variadic template' in C++? IN C++ में 'वेरिएडिक टेम्प्लेट' क्या है? A A template with variable number of type parameters प्रकार के पैरामीटरों की परिवर्तनीय संख्या वाला एक टेम्पलेट B A function with variable number of arguments तर्कों की परिवर्तनीय संख्या वाला एक फ़ंक्शन C A template that accepts any type एक टेम्पलेट जो किसी भी प्रकार को स्वीकार करता है D A C++20 concept एक C++20 अवधारणा ✅ Correct Answer: 💡 Explanation / व्याख्या Explanation (English) Variadic templates use ... to accept any number of template parameters: template. व्याख्या (हिन्दी) वैरिएडिक टेम्प्लेट किसी भी संख्या में टेम्प्लेट पैरामीटर को स्वीकार करने के लिए ... का उपयोग करते हैं: टेम्प्लेट। 🎯 Exam Perspective OOP Using C++ के इस प्रश्न को कई प्रतियोगी परीक्षाओं जैसे SSC CGL, IBPS, RRB और State-level परीक्षाओं में repeat होते देखा गया है। Concept clarity के लिए explanation section जरूर पढ़ें। 🔗 Related Questions What is the difference between pass-by-value and pass-b... What is the output: void f(int x){ x=100; } int a=5; f(... What is the output: int f(){ return 1; } int g(){ retur... 📚 Related Topic Introduction to C++ (187) Variables and Data Types (160) Operators in C++ (163)
143 Question 143 EN + हिं GB What is the output: int f(int x){ return x*2; } int(*fp)(int)=f; cout< IN आउटपुट क्या है: int f(int x){ return x*2; } int(*fp)(int)=f; अदालत A 10 10 B 5 5 C Compile error संकलन त्रुटि D Undefined अपरिभाषित ✅ Correct Answer: 💡 Explanation / व्याख्या Explanation (English) fp is a function pointer to f. fp(5)=f(5)=5*2=10. व्याख्या (हिन्दी) एफपी, एफ के लिए एक फ़ंक्शन पॉइंटर है। एफपी(5)=एफ(5)=5*2=10. 🎯 Exam Perspective यह सवाल OOP Using C++ category का है, और UPSC, SSC, Banking और Police भर्ती के exam pattern में इस तरह के questions common हैं। Answer choose करने के बाद दिया गया explanation जरूर पढ़ें। 🔗 Related Questions What is 'perfect forwarding' in C++? What is 'SFINAE' in C++? What is 'RVO' (Return Value Optimization)? 📚 Related Topic Introduction to C++ (187) Variables and Data Types (160) Operators in C++ (163)
144 Question 144 EN + हिं GB What is 'RVO' (Return Value Optimization)? IN 'आरवीओ' (रिटर्न वैल्यू ऑप्टिमाइजेशन) क्या है? A Optimization that avoids copying return value अनुकूलन जो रिटर्न वैल्यू की प्रतिलिपि बनाने से बचाता है B Runtime value optimization रनटाइम मान अनुकूलन C Recursive value optimization पुनरावर्ती मूल्य अनुकूलन D Reference value output संदर्भ मान आउटपुट ✅ Correct Answer: 💡 Explanation / व्याख्या Explanation (English) RVO/NRVO allows compiler to construct the return value directly in the caller's space, eliminating copy/move constructor calls. व्याख्या (हिन्दी) आरवीओ/एनआरवीओ कंपाइलर को कॉपी/मूव कंस्ट्रक्टर कॉल को खत्म करते हुए सीधे कॉलर के स्थान पर रिटर्न वैल्यू बनाने की अनुमति देता है। 🎯 Exam Perspective यह प्रश्न OOP Using C++ की तैयारी करने वाले अभ्यर्थियों के लिए उपयोगी है। इस तरह के प्रश्न अक्सर Railway, SSC, Banking और Defence परीक्षाओं जैसी परीक्षाओं में पूछे जाते रहे हैं, इसलिए concept और explanation दोनों को ध्यान से समझें, सिर्फ उत्तर याद न करें। 🔗 Related Questions What is the output: int f(int n){ if(n==0) return 0; re... What is the output: void f(int x){ cout What is 'SFINAE' in C++? 📚 Related Topic Introduction to C++ (187) Variables and Data Types (160) Operators in C++ (163)
145 Question 145 EN + हिं GB What is the output: int f(int& a, int b){ a=10; return a+b; } int x=5; cout< IN आउटपुट क्या है: int f(int& a, int b){ a=10; वापसी a+b; } int x=5; अदालत A 10 10 B 15 15 C 20 20 D Undefined अपरिभाषित ✅ Correct Answer: 💡 Explanation / व्याख्या Explanation (English) b is passed by value (=5 at call time). Inside f: a=10, return 10+5=15. व्याख्या (हिन्दी) b को मान (=कॉल समय पर 5) से पारित किया जाता है। f के अंदर: a=10, वापसी 10+5=15। 🎯 Exam Perspective OOP Using C++ से जुड़ा यह सवाल उन students के लिए काम का है जो SSC, Railway, Banking और State PCS की तैयारी कर रहे हैं। बेहतर होगा कि explanation पढ़कर concept clear करें, ताकि exam में similar प्रश्न आने पर confusion न हो। 🔗 Related Questions What is the output: int f(int x){ return x*2; } int(*fp... What is 'perfect forwarding' in C++? What is the output: int f(int n){ return n 📚 Related Topic Introduction to C++ (187) Variables and Data Types (160) Operators in C++ (163)
146 Question 146 EN + हिं GB What is the output: auto f=[](auto x){ return x*2; }; cout< IN आउटपुट क्या है: auto f=[](auto x){ return x*2; }; अदालत A 105 105 B Compile error संकलन त्रुटि C 105.0 105.0 D Generic lambda requires C++20 जेनेरिक लैम्ब्डा को C++20 की आवश्यकता है ✅ Correct Answer: 💡 Explanation / व्याख्या Explanation (English) Generic lambda (C++14+): f(5)=10, f(2.5)=5.0. cout<<10<<5 outputs '105'. व्याख्या (हिन्दी) जेनेरिक लैम्ब्डा (C++14+): f(5)=10, f(2.5)=5.0। अदालत 🎯 Exam Perspective SSC CGL, IBPS, RRB और State-level परीक्षाओं जैसी परीक्षाओं में OOP Using C++ से सवाल अक्सर पूछे जाते हैं। इसलिए सिर्फ answer रटने के बजाय, नीचे दी गई explanation को ध्यान से पढ़ें और concept समझें। 🔗 Related Questions What is a 'variadic template' in C++? What is the output: auto add=[](int a,int b){return a+b... What is 'RVO' (Return Value Optimization)? 📚 Related Topic Introduction to C++ (187) Variables and Data Types (160) Operators in C++ (163)
147 Question 147 EN + हिं GB What happens when a function returns a reference to a local variable? IN क्या होता है जब कोई फ़ंक्शन किसी स्थानीय चर का संदर्भ लौटाता है? A Compile error always हमेशा त्रुटि संकलित करें B Undefined behavior (dangling reference) अपरिभाषित व्यवहार (लटकता संदर्भ) C Reference extends variable lifetime संदर्भ परिवर्तनीय जीवनकाल का विस्तार करता है D Safe if variable is static यदि परिवर्तनशील स्थिर है तो सुरक्षित ✅ Correct Answer: 💡 Explanation / व्याख्या Explanation (English) Returning a reference to a local variable creates a dangling reference (undefined behavior) because the local is destroyed on return. व्याख्या (हिन्दी) स्थानीय चर के संदर्भ को वापस करने से एक लटकता हुआ संदर्भ (अपरिभाषित व्यवहार) बनता है क्योंकि वापसी पर स्थानीय नष्ट हो जाता है। 🎯 Exam Perspective अगर आप UPSC, SSC, Banking और Police भर्ती की तैयारी कर रहे हैं, तो OOP Using C++ का यह topic आपके लिए महत्वपूर्ण है। Exam में accuracy बढ़ाने के लिए हर सवाल की explanation जरूर पढ़ें। 🔗 Related Questions What is the output: int f(int n){ if(n==0) return 0; re... What is the output: auto f=[](auto x){ return x*2; }; c... What is the difference between pass-by-value and pass-b... 📚 Related Topic Introduction to C++ (187) Variables and Data Types (160) Operators in C++ (163)
148 Question 148 EN + हिं GB What is the output: int f(){ return 1; } int g(){ return 2; } cout< IN आउटपुट क्या है: int f(){ return 1; } int g(){वापसी 2; } कोउट A 3 3 B 12 12 C Unspecified order अनिर्दिष्ट आदेश D Undefined अपरिभाषित ✅ Correct Answer: 💡 Explanation / व्याख्या Explanation (English) f()+g() = 1+2 = 3. The order of evaluation of f() and g() is unspecified but result is deterministic. व्याख्या (हिन्दी) f()+g() = 1+2 = 3. f() और g() के मूल्यांकन का क्रम अनिर्दिष्ट है लेकिन परिणाम नियतात्मक है। 🎯 Exam Perspective OOP Using C++ के इस प्रश्न को कई प्रतियोगी परीक्षाओं जैसे Railway, SSC, Banking और Defence परीक्षाओं में repeat होते देखा गया है। Concept clarity के लिए explanation section जरूर पढ़ें। 🔗 Related Questions What is the output: int f(int n){ if(n==0) return 0; re... What is a 'variadic template' in C++? What is 'perfect forwarding' in C++? 📚 Related Topic Introduction to C++ (187) Variables and Data Types (160) Operators in C++ (163)
149 Question 149 EN + हिं GB What is 'perfect forwarding' in C++? IN C++ में 'परफेक्ट फ़ॉरवर्डिंग' क्या है? A Passing arguments preserving their value category (lvalue/rvalue) उनकी मूल्य श्रेणी (lvalue/rvalue) को संरक्षित करते हुए तर्क पारित करना B Inlining function calls इनलाइनिंग फ़ंक्शन कॉल C Forwarding return values वापसी मान अग्रेषित करना D Template specialization forwarding टेम्पलेट विशेषज्ञता अग्रेषण ✅ Correct Answer: 💡 Explanation / व्याख्या Explanation (English) std::forward(arg) preserves the lvalue/rvalue nature of the argument for perfect forwarding in template functions. व्याख्या (हिन्दी) std::forward(arg) टेम्प्लेट फ़ंक्शंस में सही अग्रेषण के लिए तर्क की lvalue/rvalue प्रकृति को संरक्षित करता है। 🎯 Exam Perspective यह सवाल OOP Using C++ category का है, और SSC, Railway, Banking और State PCS के exam pattern में इस तरह के questions common हैं। Answer choose करने के बाद दिया गया explanation जरूर पढ़ें। 🔗 Related Questions What is 'SFINAE' in C++? What is the output: auto add=[](int a,int b){return a+b... What is a 'variadic template' in C++? 📚 Related Topic Introduction to C++ (187) Variables and Data Types (160) Operators in C++ (163)
150 Question 150 EN + हिं GB What is the output: void f(int x){ x=100; } int a=5; f(a); cout< IN आउटपुट क्या है: void f(int x){ x=100; } int a=5; एफ(ए); अदालत A 100 100 B 5 5 C Undefined अपरिभाषित D Compile error संकलन त्रुटि ✅ Correct Answer: 💡 Explanation / व्याख्या Explanation (English) x is passed by value; modifying x inside f doesn't affect a. Output: 5. व्याख्या (हिन्दी) x मान द्वारा पारित किया गया है; x को f के अंदर संशोधित करने से a प्रभावित नहीं होता है। आउटपुट: 5. 🎯 Exam Perspective यह प्रश्न OOP Using C++ की तैयारी करने वाले अभ्यर्थियों के लिए उपयोगी है। इस तरह के प्रश्न अक्सर SSC CGL, IBPS, RRB और State-level परीक्षाओं जैसी परीक्षाओं में पूछे जाते रहे हैं, इसलिए concept और explanation दोनों को ध्यान से समझें, सिर्फ उत्तर याद न करें। 🔗 Related Questions What is the output: void f(int x){ cout What is the output: auto f=[](auto x){ return x*2; }; c... What is the output: auto add=[](int a,int b){return a+b... 📚 Related Topic Introduction to C++ (187) Variables and Data Types (160) Operators in C++ (163)