46 Question 46 EN + हिं GB What is the output: int f(int a,int b=2,int c=3){return a*b*c;} cout< IN आउटपुट क्या है: int f(int a,int b=2,int c=3){return a*b*c;} cout A 61220 61220 B Compile error संकलन त्रुटि C Undefined अपरिभाषित D 6 12 20 6 12 20 ✅ Correct Answer: 💡 Explanation / व्याख्या Explanation (English) f(1)=1*2*3=6; f(1,4)=1*4*3=12; f(1,4,5)=1*4*5=20. Output: 61220. व्याख्या (हिन्दी) f(1)=1*2*3=6; f(1,4)=1*4*3=12; f(1,4,5)=1*4*5=20. आउटपुट: 61220. 🎯 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,int y){return x==0?y:f(... What is the output: int f(int n){return (n==0||n==1)?n:... What is the output: int f(int n,int k=1){return n?f(n-1... 📚 Related Topic Introduction to C++ (187) Variables and Data Types (160) Operators in C++ (163)
47 Question 47 EN + हिं GB What is 'std::invoke_result_t'? IN 'std::invoke_result_t' क्या है? A Type of result of invoking callable with args आर्गों के साथ कॉल करने योग्य को लागू करने के परिणाम का प्रकार B Same as decltype डिक्ल्टाइप के समान C Runtime type रनटाइम प्रकार D A concept संप्रत्यय ✅ Correct Answer: 💡 Explanation / व्याख्या Explanation (English) std::invoke_result_t gives return type of F(Args...) at compile time. व्याख्या (हिन्दी) std::invoke_result_t संकलन समय पर F(Args...) का रिटर्न प्रकार देता है। 🎯 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){return x?x^f(x-1):0;}... What is 'abbreviated function template' in C++20? What is the output: int f(int x,int y){return x==0?y:f(... 📚 Related Topic Introduction to C++ (187) Variables and Data Types (160) Operators in C++ (163)
48 Question 48 EN + हिं GB What is the output: int f(int n){int r=1; while(n>1) r*=n (1, 6, 75, 5, 4, 'What is 'noexcept' function and move semantics? IN आउटपुट क्या है: int f(int n){int r=1; जबकि(n>1) r*=n (1, 6, 75, 5, 4, 'What is 'noexcept' function and move semantics? A noexcept move constructor enables std::vector to move instead of copy on reallocation noexcept मूव कंस्ट्रक्टर std::vector को पुन:आवंटन पर कॉपी करने के बजाय स्थानांतरित करने में सक्षम बनाता है B No relation कोई संबंध नहीं C Makes moves faster तेजी से कदम बढ़ाता है D C++17 only केवल सी++17 ✅ Correct Answer: 💡 Explanation / व्याख्या Explanation (English) std::vector uses move constructor only if it is noexcept; otherwise falls back to copy for exception safety. व्याख्या (हिन्दी) std::vector मूव कंस्ट्रक्टर का उपयोग केवल तभी करता है जब यह कोई अपवाद न हो; अन्यथा अपवाद सुरक्षा के लिए प्रतिलिपि पर वापस आ जाता है। 🎯 Exam Perspective यह प्रश्न OOP Using C++ ("Functions" sub-topic) की तैयारी करने वाले अभ्यर्थियों के लिए उपयोगी है। इस तरह के प्रश्न अक्सर SSC, Railway, Banking और State PCS जैसी परीक्षाओं में पूछे जाते रहे हैं, इसलिए concept और explanation दोनों को ध्यान से समझें, सिर्फ उत्तर याद न करें। 🔗 Related Questions What is the output: auto f=[](auto x,auto y){return x What is 'noexcept' function and move semantics? What is 'abbreviated function template' in C++20? 📚 Related Topic Introduction to C++ (187) Variables and Data Types (160) Operators in C++ (163)
49 Question 49 EN + हिं GB What is 'noexcept' function and move semantics? IN 'नोएक्सेप्ट' फ़ंक्शन और मूव सिमेंटिक्स क्या है? A noexcept move constructor enables std::vector to move instead of copy on reallocation noexcept मूव कंस्ट्रक्टर std::vector को पुन:आवंटन पर कॉपी करने के बजाय स्थानांतरित करने में सक्षम बनाता है B No relation कोई संबंध नहीं C Makes moves faster तेजी से कदम बढ़ाता है D C++17 only केवल सी++17 ✅ Correct Answer: 💡 Explanation / व्याख्या Explanation (English) std::vector uses move constructor only if it is noexcept; otherwise falls back to copy for exception safety. व्याख्या (हिन्दी) std::vector मूव कंस्ट्रक्टर का उपयोग केवल तभी करता है जब यह कोई अपवाद न हो; अन्यथा अपवाद सुरक्षा के लिए प्रतिलिपि पर वापस आ जाता है। 🎯 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 'std::transform_reduce'? What is the output: int f(int a,int b=2,int c=3){return... What is 'abbreviated function template' in C++20? 📚 Related Topic Introduction to C++ (187) Variables and Data Types (160) Operators in C++ (163)
50 Question 50 EN + हिं GB What is the output: auto f=[](auto x,auto y){return x IN आउटपुट क्या है: ऑटो f=[](ऑटो x,ऑटो y){रिटर्न x A 32.0 32.0 B Compile error संकलन त्रुटि C 35 35 D Undefined अपरिभाषित ✅ Correct Answer: 💡 Explanation / व्याख्या Explanation (English) f(3,5)=3, f(4.0,2.0)=2.0. Output: 32. व्याख्या (हिन्दी) f(3,5)=3, f(4.0,2.0)=2.0. आउटपुट: 32. 🎯 Exam Perspective UPSC, SSC, Banking और Police भर्ती जैसी परीक्षाओं में OOP Using C++ ("Functions" sub-topic) से सवाल अक्सर पूछे जाते हैं। इसलिए सिर्फ answer रटने के बजाय, नीचे दी गई explanation को ध्यान से पढ़ें और concept समझें। 🔗 Related Questions What is 'std::invoke_result_t'? What is the output: int f(int n){int r=1; while(n>1) r*... What is the output: int f(int n,int k=1){return n?f(n-1... 📚 Related Topic Introduction to C++ (187) Variables and Data Types (160) Operators in C++ (163)
51 Question 51 EN + हिं GB What is 'overloading vs overriding'? IN 'ओवरलोडिंग बनाम ओवरराइडिंग' क्या है? A Overloading: same name diff params; overriding: replaces virtual ओवरलोडिंग: समान नाम भिन्न पैरामीटर; ओवरराइडिंग: वर्चुअल को प्रतिस्थापित करता है B Same thing एक ही बात C Overriding is compile-time ओवरराइडिंग संकलन-समय है D Overloading is runtime ओवरलोडिंग रनटाइम है ✅ Correct Answer: 💡 Explanation / व्याख्या Explanation (English) Overloading is compile-time selection by signature; overriding is runtime dispatch via vtable. व्याख्या (हिन्दी) ओवरलोडिंग हस्ताक्षर द्वारा संकलन-समय चयन है; ओवरराइडिंग vtable के माध्यम से रनटाइम प्रेषण है। 🎯 Exam Perspective अगर आप Railway, SSC, Banking और Defence परीक्षाओं की तैयारी कर रहे हैं, तो OOP Using C++ ("Functions" sub-topic) का यह topic आपके लिए महत्वपूर्ण है। Exam में accuracy बढ़ाने के लिए हर सवाल की explanation जरूर पढ़ें। 🔗 Related Questions What is 'trailing requires clause' in C++20? What is the output: int f(int n){int r=1; while(n>1) r*... What is the output: int f(int x){return x?x^f(x-1):0;}... 📚 Related Topic Introduction to C++ (187) Variables and Data Types (160) Operators in C++ (163)
52 Question 52 EN + हिं GB What is the output: int f(int x){return x?x^f(x-1):0;} cout< IN आउटपुट क्या है: int f(int x){return x?x^f(x-1):0;} cout A 1 1 C Compile error संकलन त्रुटि D Undefined अपरिभाषित ✅ Correct Answer: 💡 Explanation / व्याख्या Explanation (English) f(5)=5^f(4)=5^(4^f(3))=5^4^3^2^1^0=1. Output: 1. व्याख्या (हिन्दी) f(5)=5^f(4)=5^(4^f(3))=5^4^3^2^1^0=1. आउटपुट: 1. 🎯 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 x,int y){return x==0?y:f(... What is the output: int r=0; auto f=[&r](auto self,int... What is the output: int f(int a,int b=2,int c=3){return... 📚 Related Topic Introduction to C++ (187) Variables and Data Types (160) Operators in C++ (163)
53 Question 53 EN + हिं GB What is the output: int r=0; auto f=[&r](auto self,int n)->void{if(n>0){r+=n;self(self,n-1);}}; f(f,5); cout< IN आउटपुट क्या है: int r=0; auto f=[&r](auto self,int n)->void{if(n>0){r+=n;self(self,n-1);}}; एफ(एफ,5); अदालत A 15 15 B 5 5 C Compile error संकलन त्रुटि D Undefined अपरिभाषित ✅ Correct Answer: 💡 Explanation / व्याख्या Explanation (English) 5+4+3+2+1=15. Output: 15. व्याख्या (हिन्दी) 5+4+3+2+1=15. आउटपुट: 15. 🎯 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 'std::invoke_result_t'? What is the output: int f(int n){int r=1; while(n>1) r*... What is the output: int f(int n){return (n==0||n==1)?n:... 📚 Related Topic Introduction to C++ (187) Variables and Data Types (160) Operators in C++ (163)
54 Question 54 EN + हिं GB What is 'std::transform_reduce'? IN 'std::transform_reduce' क्या है? A Map then reduce: apply transform then reduction मानचित्र फिर कम करें: परिवर्तन लागू करें फिर कमी करें B Same as inner_product आंतरिक_उत्पाद के समान C Parallel sort समानांतर प्रकार D A filter+map एक फ़िल्टर+मानचित्र ✅ Correct Answer: 💡 Explanation / व्याख्या Explanation (English) transform_reduce applies a unary op to elements then reduces; parallel version of inner_product. व्याख्या (हिन्दी) ट्रांसफ़ॉर्म_रिड्यूस तत्वों पर एक यूनरी ऑप लागू करता है और फिर कम कर देता है; इनर_प्रोडक्ट का समानांतर संस्करण। 🎯 Exam Perspective यह प्रश्न OOP Using C++ ("Functions" sub-topic) की तैयारी करने वाले अभ्यर्थियों के लिए उपयोगी है। इस तरह के प्रश्न अक्सर UPSC, SSC, Banking और Police भर्ती जैसी परीक्षाओं में पूछे जाते रहे हैं, इसलिए concept और explanation दोनों को ध्यान से समझें, सिर्फ उत्तर याद न करें। 🔗 Related Questions What is the output: int f(int n,int k=1){return n?f(n-1... What is 'noexcept' function and move semantics? What is the output: int f(int x){return x?x^f(x-1):0;}... 📚 Related Topic Introduction to C++ (187) Variables and Data Types (160) Operators in C++ (163)
55 Question 55 EN + हिं GB What is the output: int f(int x){return x;} auto& g=f; cout< IN आउटपुट क्या है: int f(int x){return x;} auto& g=f; अदालत A 5 5 B Compile error संकलन त्रुटि C Undefined अपरिभाषित ✅ Correct Answer: 💡 Explanation / व्याख्या Explanation (English) Function references work like function pointers. g(5)=f(5)=5. Output: 5. व्याख्या (हिन्दी) फ़ंक्शन संदर्भ फ़ंक्शन पॉइंटर्स की तरह काम करते हैं। g(5)=f(5)=5. आउटपुट: 5. 🎯 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 r=0; auto f=[&r](auto self,int... What is 'overloading vs overriding'? What is the output: int f(int n){return (n==0||n==1)?n:... 📚 Related Topic Introduction to C++ (187) Variables and Data Types (160) Operators in C++ (163)
56 Question 56 EN + हिं GB What is 'trailing requires clause' in C++20? IN C++20 में 'ट्रेलिंग रिक्वायर्ड क्लॉज' क्या है? A auto f(T x) requires Concept<T> — constrains template ऑटो f(T x) के लिए संकल्पना - बाधा टेम्पलेट की आवश्यकता होती है B Same as enable_if Enable_if के समान C Runtime check रनटाइम जांच D A return type एक वापसी प्रकार ✅ Correct Answer: 💡 Explanation / व्याख्या Explanation (English) Trailing requires: template void f(T) requires std::integral{} — cleaner than enable_if. व्याख्या (हिन्दी) ट्रेलिंग के लिए आवश्यक है: टेम्पलेट शून्य f(T) के लिए std::integral{} की आवश्यकता है - Enable_if की तुलना में अधिक साफ़। 🎯 Exam Perspective SSC, Railway, Banking और State PCS जैसी परीक्षाओं में OOP Using C++ ("Functions" sub-topic) से सवाल अक्सर पूछे जाते हैं। इसलिए सिर्फ answer रटने के बजाय, नीचे दी गई explanation को ध्यान से पढ़ें और concept समझें। 🔗 Related Questions What is the output: int r=0; auto f=[&r](auto self,int... What is the output: int f(int n){int r=1; while(n>1) r*... What is the output: int f(int x){return x;} auto& g=f;... 📚 Related Topic Introduction to C++ (187) Variables and Data Types (160) Operators in C++ (163)
57 Question 57 EN + हिं GB What is the output: int f(int x,int y){return x==0?y:f(y%x,x);} cout< IN आउटपुट क्या है: int f(int x,int y){return x==0?y:f(y%x,x);} cout A 14 14 B 7 7 C Compile error संकलन त्रुटि D Undefined अपरिभाषित ✅ Correct Answer: 💡 Explanation / व्याख्या Explanation (English) GCD(56,98): f(98%56,56)=f(42,56)=f(56%42,42)=f(14,42)=f(42%14,14)=f(0,14)=14. Output: 14. व्याख्या (हिन्दी) जीसीडी(56,98): f(98%56,56)=f(42,56)=f(56%42,42)=f(14,42)=f(42%14,14)=f(0,14)=14। आउटपुट: 14. 🎯 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 n,int k=1){return n?f(n-1... What is the output: int f(int x){return x;} auto& g=f;... What is 'abbreviated function template' in C++20? 📚 Related Topic Introduction to C++ (187) Variables and Data Types (160) Operators in C++ (163)
58 Question 58 EN + हिं GB What is the output: int f(int n){return (n==0||n==1)?n:f(n-1)+f(n-2);} cout< IN आउटपुट क्या है: int f(int n){return (n==0||n==1)?n:f(n-1)+f(n-2);} cout A 21 21 B 13 13 C Compile error संकलन त्रुटि D Undefined अपरिभाषित ✅ Correct Answer: 💡 Explanation / व्याख्या Explanation (English) Fib: 0,1,1,2,3,5,8,13,21. f(8)=21. Output: 21. व्याख्या (हिन्दी) फाइब: 0,1,1,2,3,5,8,13,21. एफ(8)=21. आउटपुट: 21. 🎯 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){return x?x^f(x-1):0;}... What is the output: int f(int x){return x;} auto& g=f;... What is the output: int f(int x,int y){return x==0?y:f(... 📚 Related Topic Introduction to C++ (187) Variables and Data Types (160) Operators in C++ (163)
59 Question 59 EN + हिं GB What is 'abbreviated function template' in C++20? IN C++20 में 'संक्षिप्त फ़ंक्शन टेम्पलेट' क्या है? A void f(auto x) — shorthand for template<typename T> void f(T x) शून्य f(ऑटो x) - टेम्पलेट शून्य f(T x) के लिए आशुलिपि B Lambda shorthand लैम्ब्डा आशुलिपि C C++17 feature सी++17 सुविधा D Macro shorthand मैक्रो आशुलिपि ✅ Correct Answer: 💡 Explanation / व्याख्या Explanation (English) C++20: void f(auto x){} is equivalent to template void f(T x){}. व्याख्या (हिन्दी) C++20: void f(auto x){} टेम्पलेट void f(T x){} के बराबर है। 🎯 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,int y){return x==0?y:f(... What is the output: int f(int x){return x?x^f(x-1):0;}... What is the output: int f(int n){return (n==0||n==1)?n:... 📚 Related Topic Introduction to C++ (187) Variables and Data Types (160) Operators in C++ (163)
60 Question 60 EN + हिं GB What is the output: int f(int n,int k=1){return n?f(n-1,k*n):k;} cout< IN आउटपुट क्या है: int f(int n,int k=1){return n?f(n-1,k*n):k;} cout A 120 120 B 5 5 C Compile error संकलन त्रुटि D Undefined अपरिभाषित ✅ Correct Answer: 💡 Explanation / व्याख्या Explanation (English) Accumulates 5*4*3*2*1*1=120. Output: 120. व्याख्या (हिन्दी) 5*4*3*2*1*1=120 जमा होता है। आउटपुट: 120. 🎯 Exam Perspective यह प्रश्न OOP Using C++ ("Functions" sub-topic) की तैयारी करने वाले अभ्यर्थियों के लिए उपयोगी है। इस तरह के प्रश्न अक्सर SSC, Railway, Banking और State PCS जैसी परीक्षाओं में पूछे जाते रहे हैं, इसलिए concept और explanation दोनों को ध्यान से समझें, सिर्फ उत्तर याद न करें। 🔗 Related Questions What is the output: int f(int x,int y){return x==0?y:f(... What is 'abbreviated function template' in C++20? What is 'noexcept' function and move semantics? 📚 Related Topic Introduction to C++ (187) Variables and Data Types (160) Operators in C++ (163)