1 Question 1 EN + हिं GB What is the output: int f(int x=1,int y=2){ return x+y; } cout< IN आउटपुट क्या है: int f(int x=1,int y=2){ return x+y; } कोउट A 3 5 7 3 5 7 B 357 357 C Compile error संकलन त्रुटि D 125 125 ✅ Correct Answer: 💡 Explanation / व्याख्या Explanation (English) f()=1+2=3, f(3)=3+2=5, f(3,4)=3+4=7. Concatenated: 357. व्याख्या (हिन्दी) f()=1+2=3, f(3)=3+2=5, f(3,4)=3+4=7. संयोजित: 357. 🎯 Exam Perspective OOP Using C++ ("Functions" sub-topic) से जुड़ा यह सवाल उन students के लिए काम का है जो SSC CGL, IBPS, RRB और State-level परीक्षाओं की तैयारी कर रहे हैं। बेहतर होगा कि explanation पढ़कर concept clear करें, ताकि exam में similar प्रश्न आने पर confusion न हो। 🔗 Related Questions What is a 'variadic template' in C++? What is 'SFINAE' in C++? What is 'tail call optimization'? 📚 Related Topic Introduction to C++ (187) Variables and Data Types (160) Operators in C++ (163)
2 Question 2 EN + हिं GB What is the output: void f(int& x){ x=10; } int a=5; f(a); cout< IN आउटपुट क्या है: void f(int& x){ x=10; } int a=5; एफ(ए); अदालत A 5 5 B 10 10 C Undefined अपरिभाषित D Compile error संकलन त्रुटि ✅ Correct Answer: 💡 Explanation / व्याख्या Explanation (English) f takes a reference to int; modifying x modifies a. Output: 10. व्याख्या (हिन्दी) f int का संदर्भ लेता है; x को संशोधित करने से a संशोधित हो जाता है। आउटपुट: 10. 🎯 Exam Perspective UPSC, SSC, Banking और Police भर्ती जैसी परीक्षाओं में OOP Using C++ ("Functions" sub-topic) से सवाल अक्सर पूछे जाते हैं। इसलिए सिर्फ answer रटने के बजाय, नीचे दी गई explanation को ध्यान से पढ़ें और concept समझें। 🔗 Related Questions What is the difference between pass-by-value and pass-b... What is the output: auto add=[](int a,int b){return a+b... What is the output: int f(int x=1,int y=2){ return x+y;... 📚 Related Topic Introduction to C++ (187) Variables and Data Types (160) Operators in C++ (163)
3 Question 3 EN + हिं GB What is 'function overload resolution' in C++? IN C++ में 'फ़ंक्शन ओवरलोड रिज़ॉल्यूशन' क्या है? A Choosing the best matching overload at compile time संकलन समय पर सर्वोत्तम मिलान अधिभार का चयन करना B Resolving function calls at runtime रनटाइम पर फ़ंक्शन कॉल का समाधान करना C Template deduction टेम्पलेट कटौती D Linker selecting function लिंकर चयन फ़ंक्शन ✅ Correct Answer: 💡 Explanation / व्याख्या Explanation (English) Overload resolution happens at compile time: the compiler selects the best matching function from a set of candidates based on argument types. व्याख्या (हिन्दी) ओवरलोड रिज़ॉल्यूशन संकलन समय पर होता है: कंपाइलर तर्क प्रकारों के आधार पर उम्मीदवारों के एक सेट से सबसे अच्छे मिलान फ़ंक्शन का चयन करता है। 🎯 Exam Perspective अगर आप Railway, SSC, Banking और Defence परीक्षाओं की तैयारी कर रहे हैं, तो OOP Using C++ ("Functions" sub-topic) का यह topic आपके लिए महत्वपूर्ण है। Exam में accuracy बढ़ाने के लिए हर सवाल की explanation जरूर पढ़ें। 🔗 Related Questions What is the output: int f(int n){ if(n==0) return 0; re... What is the output: int f(int x=1,int y=2){ return x+y;... What is a lambda closure in C++? 📚 Related Topic Introduction to C++ (187) Variables and Data Types (160) Operators in C++ (163)
4 Question 4 EN + हिं GB What is a lambda closure in C++? IN C++ में लैम्ब्डा क्लोजर क्या है? A A function pointer एक फ़ंक्शन सूचक B An anonymous function object that can capture local variables एक अनाम फ़ंक्शन ऑब्जेक्ट जो स्थानीय चर को कैप्चर कर सकता है C A virtual function एक आभासी कार्य D A member function pointer एक सदस्य फ़ंक्शन सूचक ✅ Correct Answer: 💡 Explanation / व्याख्या Explanation (English) A lambda creates a closure object (anonymous class) that captures surrounding local variables and has operator() defined. व्याख्या (हिन्दी) लैम्ब्डा एक क्लोजर ऑब्जेक्ट (अनाम वर्ग) बनाता है जो आसपास के स्थानीय चर को कैप्चर करता है और ऑपरेटर() को परिभाषित करता है। 🎯 Exam Perspective OOP Using C++ ("Functions" sub-topic) के इस प्रश्न को कई प्रतियोगी परीक्षाओं जैसे SSC, Railway, Banking और State PCS में repeat होते देखा गया है। Concept clarity के लिए explanation section जरूर पढ़ें। 🔗 Related Questions What is the output: int f(int n){ if(n==0) return 0; re... What is the output: int f(int n){ return n 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)
5 Question 5 EN + हिं GB What is the output: int f(){ static int x=0; return ++x; } cout< IN आउटपुट क्या है: int f(){static int x=0; वापसी++x; } कोउट A 111 111 B 123 123 C Unspecified अनिर्दिष्ट D Undefined अपरिभाषित ✅ Correct Answer: 💡 Explanation / व्याख्या Explanation (English) Pre-C++17, order of evaluation of arguments to << is unspecified. Each call increments x, but print order is unspecified. व्याख्या (हिन्दी) प्री-सी++17, तर्कों के मूल्यांकन का क्रम 🎯 Exam Perspective यह सवाल OOP Using C++ ("Functions" sub-topic) category का है, और SSC CGL, IBPS, RRB और State-level परीक्षाओं के exam pattern में इस तरह के questions common हैं। Answer choose करने के बाद दिया गया explanation जरूर पढ़ें। 🔗 Related Questions What is the output: auto add=[](int a,int b){return a+b... What is 'tail call optimization'? What is the output: void f(int x){ cout 📚 Related Topic Introduction to C++ (187) Variables and Data Types (160) Operators in C++ (163)
6 Question 6 EN + हिं GB What is 'tail call optimization'? IN 'टेल कॉल ऑप्टिमाइज़ेशन' क्या है? A Optimizing the last statement अंतिम कथन का अनुकूलन B Reusing the caller's stack frame for a tail-recursive call टेल-रिकर्सिव कॉल के लिए कॉलर के स्टैक फ़्रेम का पुन: उपयोग करना C Inlining recursive functions पुनरावर्ती कार्यों को इनलाइन करना D Eliminating loops लूपों को हटाना ✅ Correct Answer: 💡 Explanation / व्याख्या Explanation (English) TCO allows a tail call to reuse the current stack frame, preventing stack overflow in tail-recursive functions. Not guaranteed by C++ standard but done by many compilers. व्याख्या (हिन्दी) TCO टेल कॉल को वर्तमान स्टैक फ्रेम का पुन: उपयोग करने की अनुमति देता है, जिससे टेल-रिकर्सिव फ़ंक्शंस में स्टैक ओवरफ़्लो को रोका जा सकता है। C++ मानक द्वारा इसकी गारंटी नहीं है लेकिन कई कंपाइलरों द्वारा इसकी गारंटी दी गई है। 🎯 Exam Perspective यह प्रश्न OOP Using C++ ("Functions" sub-topic) की तैयारी करने वाले अभ्यर्थियों के लिए उपयोगी है। इस तरह के प्रश्न अक्सर UPSC, SSC, Banking और Police भर्ती जैसी परीक्षाओं में पूछे जाते रहे हैं, इसलिए concept और explanation दोनों को ध्यान से समझें, सिर्फ उत्तर याद न करें। 🔗 Related Questions What is the output: void f(int& x){ x=10; } int a=5; f(... What is the output: int f(int n){ if(n==0) return 0; re... What is the output: void f(int x){ cout 📚 Related Topic Introduction to C++ (187) Variables and Data Types (160) Operators in C++ (163)
7 Question 7 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++ ("Functions" sub-topic) से जुड़ा यह सवाल उन students के लिए काम का है जो Railway, SSC, Banking और Defence परीक्षाओं की तैयारी कर रहे हैं। बेहतर होगा कि explanation पढ़कर concept clear करें, ताकि exam में similar प्रश्न आने पर confusion न हो। 🔗 Related Questions What is the output: int f(int x=1,int y=2){ return x+y;... What is 'function overload resolution' in C++? What is 'SFINAE' in C++? 📚 Related Topic Introduction to C++ (187) Variables and Data Types (160) Operators in C++ (163)
8 Question 8 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 SSC, Railway, Banking और State PCS जैसी परीक्षाओं में OOP Using C++ ("Functions" sub-topic) से सवाल अक्सर पूछे जाते हैं। इसलिए सिर्फ answer रटने के बजाय, नीचे दी गई explanation को ध्यान से पढ़ें और concept समझें। 🔗 Related Questions What is the output: void f(int& x){ x=10; } int a=5; f(... What is 'tail call optimization'? 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)
9 Question 9 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 अगर आप SSC CGL, IBPS, RRB और State-level परीक्षाओं की तैयारी कर रहे हैं, तो OOP Using C++ ("Functions" sub-topic) का यह topic आपके लिए महत्वपूर्ण है। Exam में accuracy बढ़ाने के लिए हर सवाल की explanation जरूर पढ़ें। 🔗 Related Questions What is the output: int f(int x=1,int y=2){ return x+y;... What is a 'variadic template' in C++? What is the output: int f(int x){ return x*2; } int(*fp... 📚 Related Topic Introduction to C++ (187) Variables and Data Types (160) Operators in C++ (163)
10 Question 10 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++ ("Functions" sub-topic) के इस प्रश्न को कई प्रतियोगी परीक्षाओं जैसे UPSC, SSC, Banking और Police भर्ती में repeat होते देखा गया है। Concept clarity के लिए explanation section जरूर पढ़ें। 🔗 Related Questions What is the output: int f(int x=1,int y=2){ return x+y;... What is a 'variadic template' in C++? What is 'RVO' (Return Value Optimization)? 📚 Related Topic Introduction to C++ (187) Variables and Data Types (160) Operators in C++ (163)
11 Question 11 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 यह सवाल OOP Using C++ ("Functions" sub-topic) category का है, और Railway, SSC, Banking और Defence परीक्षाओं के exam pattern में इस तरह के questions common हैं। Answer choose करने के बाद दिया गया explanation जरूर पढ़ें। 🔗 Related Questions What is the output: int f(int x=1,int y=2){ return x+y;... What is 'RVO' (Return Value Optimization)? 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)
12 Question 12 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 यह प्रश्न OOP Using C++ ("Functions" sub-topic) की तैयारी करने वाले अभ्यर्थियों के लिए उपयोगी है। इस तरह के प्रश्न अक्सर SSC, Railway, Banking और State PCS जैसी परीक्षाओं में पूछे जाते रहे हैं, इसलिए concept और explanation दोनों को ध्यान से समझें, सिर्फ उत्तर याद न करें। 🔗 Related Questions What is 'function overload resolution' in C++? What is the output: void f(int x){ cout What is the output: int f(int x=1,int y=2){ return x+y;... 📚 Related Topic Introduction to C++ (187) Variables and Data Types (160) Operators in C++ (163)
13 Question 13 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++ ("Functions" sub-topic) से जुड़ा यह सवाल उन students के लिए काम का है जो SSC CGL, IBPS, RRB और State-level परीक्षाओं की तैयारी कर रहे हैं। बेहतर होगा कि explanation पढ़कर concept clear करें, ताकि exam में similar प्रश्न आने पर confusion न हो। 🔗 Related Questions What is the output: int f(){ static int x=0; return ++x... What is 'RVO' (Return Value Optimization)? What is 'SFINAE' in C++? 📚 Related Topic Introduction to C++ (187) Variables and Data Types (160) Operators in C++ (163)
14 Question 14 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 UPSC, SSC, Banking और Police भर्ती जैसी परीक्षाओं में OOP Using C++ ("Functions" sub-topic) से सवाल अक्सर पूछे जाते हैं। इसलिए सिर्फ answer रटने के बजाय, नीचे दी गई explanation को ध्यान से पढ़ें और concept समझें। 🔗 Related Questions What is the output: int f(int x=1,int y=2){ return x+y;... What is the output: auto add=[](int a,int b){return a+b... 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)
15 Question 15 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 अगर आप Railway, SSC, Banking और Defence परीक्षाओं की तैयारी कर रहे हैं, तो OOP Using C++ ("Functions" sub-topic) का यह topic आपके लिए महत्वपूर्ण है। Exam में accuracy बढ़ाने के लिए हर सवाल की explanation जरूर पढ़ें। 🔗 Related Questions What is the output: void f(int& x){ x=10; } int a=5; f(... What is the output: auto add=[](int a,int b){return a+b... What is the output: int f(int x=1,int y=2){ return x+y;... 📚 Related Topic Introduction to C++ (187) Variables and Data Types (160) Operators in C++ (163)