61 Question 61 EN + हिं GB What is the output: template constexpr auto makeArray(){array a{}; for(size_t i=0;i(); cout< IN आउटपुट क्या है: template constexpr auto makeArray(){array a{}; for(size_t i=0;i A 9 9 B 3 3 C Compile error संकलन त्रुटि D Undefined अपरिभाषित ✅ Correct Answer: 💡 Explanation / व्याख्या Explanation (English) a[3]=3*3=9. Output: 9. व्याख्या (हिन्दी) ए[3]=3*3=9. आउटपुट: 9. 🎯 Exam Perspective OOP Using C++ ("Templates" sub-topic) से जुड़ा यह सवाल उन students के लिए काम का है जो UPSC, SSC, Banking और Police भर्ती की तैयारी कर रहे हैं। बेहतर होगा कि explanation पढ़कर concept clear करें, ताकि exam में similar प्रश्न आने पर confusion न हो। 🔗 Related Questions What is the output: template constexpr int sumNT=(...+N... What is the output: template int countIf(vector& v,Pred... What is the output: template vector filter(vector v,fun... 📚 Related Topic Introduction to C++ (187) Variables and Data Types (160) Operators in C++ (163)
62 Question 62 EN + हिं GB What is the output: template class Optional{bool has=false; T v; public: void set(T x){has=true;v=x;} bool hasVal(){return has;} T get(){return v;}}; Optional o; cout< IN आउटपुट क्या है: टेम्पलेट क्लास वैकल्पिक {बूल है = गलत; टी वी; सार्वजनिक: void set(T x){has=true;v=x;} bool hasVal(){return has;} T get(){return v;}}; वैकल्पिक ओ; अदालत A 015 015 B Compile error संकलन त्रुटि C Undefined अपरिभाषित D 0 1 5 0 1 5 ✅ Correct Answer: 💡 Explanation / व्याख्या Explanation (English) Initial: 0. After set: 1, get=5. Output: 015. व्याख्या (हिन्दी) आरंभिक: 0. सेट के बाद: 1, प्राप्त करें=5. आउटपुट: 015. 🎯 Exam Perspective Railway, SSC, Banking और Defence परीक्षाओं जैसी परीक्षाओं में OOP Using C++ ("Templates" sub-topic) से सवाल अक्सर पूछे जाते हैं। इसलिए सिर्फ answer रटने के बजाय, नीचे दी गई explanation को ध्यान से पढ़ें और concept समझें। 🔗 Related Questions What is the output: template class Singleton{static T*... What is the output: template T reduce(vector v,T init,f... What is the output: template T sq(T x){return x*x;} tem... 📚 Related Topic Introduction to C++ (187) Variables and Data Types (160) Operators in C++ (163)
63 Question 63 EN + हिं GB What is the output: template int countIf(vector& v,Pred p){int n=0;for(auto x:v) if(p(x)) n++;return n;} vectorv={1,2,3,4,5}; cout< IN आउटपुट क्या है: टेम्पलेट int countIf(वेक्टर& v,Pred p){int n=0;for(auto x:v) if(p(x)) n++;रिटर्न n;} वेक्टरv={1,2,3,4,5}; अदालत A 2 2 B 3 3 C Compile error संकलन त्रुटि D Undefined अपरिभाषित ✅ Correct Answer: 💡 Explanation / व्याख्या Explanation (English) 2 and 4 are even. count=2. Output: 2. व्याख्या (हिन्दी) 2 और 4 सम हैं. गिनती=2. आउटपुट: 2. 🎯 Exam Perspective अगर आप SSC, Railway, Banking और State PCS की तैयारी कर रहे हैं, तो OOP Using C++ ("Templates" sub-topic) का यह topic आपके लिए महत्वपूर्ण है। Exam में accuracy बढ़ाने के लिए हर सवाल की explanation जरूर पढ़ें। 🔗 Related Questions What is the output: template constexpr int sumNT=(...+N... What is the output: template T myMin(T a,T b){return a What is the output: template class Singleton{static T*... 📚 Related Topic Introduction to C++ (187) Variables and Data Types (160) Operators in C++ (163)
64 Question 64 EN + हिं GB What is the output: template T lerp(T a,T b,double t){return a+(b-a)*t;} cout< IN आउटपुट क्या है: टेम्पलेट T lerp(T a,T b,double t){return a+(b-a)*t;} cout A 5 5 C Compile error संकलन त्रुटि D Undefined अपरिभाषित ✅ Correct Answer: 💡 Explanation / व्याख्या Explanation (English) 0+(10-0)*0.5=5. Output: 5. व्याख्या (हिन्दी) 0+(10-0)*0.5=5. आउटपुट: 5. 🎯 Exam Perspective OOP Using C++ ("Templates" sub-topic) के इस प्रश्न को कई प्रतियोगी परीक्षाओं जैसे SSC CGL, IBPS, RRB और State-level परीक्षाओं में repeat होते देखा गया है। Concept clarity के लिए explanation section जरूर पढ़ें। 🔗 Related Questions What is the output: template T myMin(T a,T b){return a What is the output: template class Singleton{static T*... What is the output: template auto zip(vectora,vectorb){... 📚 Related Topic Introduction to C++ (187) Variables and Data Types (160) Operators in C++ (163)
65 Question 65 EN + हिं GB What is the output: template T gcd(T a,T b){return b?gcd(b,a%b):a;} cout< IN आउटपुट क्या है: टेम्पलेट T gcd(T a,T b){return b?gcd(b,a%b):a;} cout A 12 12 B 6 6 C Compile error संकलन त्रुटि D Undefined अपरिभाषित ✅ Correct Answer: 💡 Explanation / व्याख्या Explanation (English) GCD(36,48)=GCD(48,36)=GCD(36,12)=GCD(12,0)=12. Output: 12. व्याख्या (हिन्दी) जीसीडी(36,48)=जीसीडी(48,36)=जीसीडी(36,12)=जीसीडी(12,0)=12। आउटपुट: 12. 🎯 Exam Perspective यह सवाल OOP Using C++ ("Templates" sub-topic) category का है, और UPSC, SSC, Banking और Police भर्ती के exam pattern में इस तरह के questions common हैं। Answer choose करने के बाद दिया गया explanation जरूर पढ़ें। 🔗 Related Questions What is the output: template class TypeList{}; cout What is the output: template int countIf(vector& v,Pred... What is the output: template vector filter(vector v,fun... 📚 Related Topic Introduction to C++ (187) Variables and Data Types (160) Operators in C++ (163)
66 Question 66 EN + हिं GB What is the output: template vector filter(vector v,function p){vectorr;for(T x:v)if(p(x))r.push_back(x);return r;} auto r=filter({1,2,3,4,5},[](int x){return x>3;}); cout< IN आउटपुट क्या है: टेम्पलेट वेक्टर फ़िल्टर(वेक्टर v,फ़ंक्शन p){vectorr;for(T x:v)if(p(x))r.push_back(x);return r;} auto r=filter({1,2,3,4,5},[](int x){return x>3;}); अदालत A 2 2 B 3 3 C Compile error संकलन त्रुटि D Undefined अपरिभाषित ✅ Correct Answer: 💡 Explanation / व्याख्या Explanation (English) 4 and 5. size=2. Output: 2. व्याख्या (हिन्दी) 4 और 5. आकार=2. आउटपुट: 2. 🎯 Exam Perspective यह प्रश्न OOP Using C++ ("Templates" sub-topic) की तैयारी करने वाले अभ्यर्थियों के लिए उपयोगी है। इस तरह के प्रश्न अक्सर Railway, SSC, Banking और Defence परीक्षाओं जैसी परीक्षाओं में पूछे जाते रहे हैं, इसलिए concept और explanation दोनों को ध्यान से समझें, सिर्फ उत्तर याद न करें। 🔗 Related Questions What is the output: template class Singleton{static T*... What is the output: template struct IsIntegral{static c... What is the output: template int countIf(vector& v,Pred... 📚 Related Topic Introduction to C++ (187) Variables and Data Types (160) Operators in C++ (163)
67 Question 67 EN + हिं GB What is the output: template T reduce(vector v,T init,function f){for(T x:v) init=f(init,x);return init;} cout<({1,2,3,4,5},0,[](int a,int b){return a+b;}); IN आउटपुट क्या है: टेम्पलेट T कम करें(वेक्टर v,T init,function f){for(T x:v) init=f(init,x);रिटर्न init;} cout A 15 15 C Compile error संकलन त्रुटि D Undefined अपरिभाषित ✅ Correct Answer: 💡 Explanation / व्याख्या Explanation (English) Sum=15. Output: 15. व्याख्या (हिन्दी) योग=15. आउटपुट: 15. 🎯 Exam Perspective OOP Using C++ ("Templates" sub-topic) से जुड़ा यह सवाल उन students के लिए काम का है जो SSC, Railway, Banking और State PCS की तैयारी कर रहे हैं। बेहतर होगा कि explanation पढ़कर concept clear करें, ताकि exam में similar प्रश्न आने पर confusion न हो। 🔗 Related Questions What is the output: template T lerp(T a,T b,double t){r... What is the output: template constexpr auto makeArray()... What is the output: template constexpr int sumNT=(...+N... 📚 Related Topic Introduction to C++ (187) Variables and Data Types (160) Operators in C++ (163)
68 Question 68 EN + हिं GB What is the output: template T myMin(T a,T b){return a T myMin(T a,Rest...rest){return myMin(a,myMin(rest...));} cout< IN आउटपुट क्या है: टेम्पलेट T myMin(T a,T b){return a A 1 1 B 3 3 C Compile error संकलन त्रुटि D Undefined अपरिभाषित ✅ Correct Answer: 💡 Explanation / व्याख्या Explanation (English) min of all = 1. Output: 1. व्याख्या (हिन्दी) सभी का न्यूनतम = 1. आउटपुट: 1. 🎯 Exam Perspective SSC CGL, IBPS, RRB और State-level परीक्षाओं जैसी परीक्षाओं में OOP Using C++ ("Templates" sub-topic) से सवाल अक्सर पूछे जाते हैं। इसलिए सिर्फ answer रटने के बजाय, नीचे दी गई explanation को ध्यान से पढ़ें और concept समझें। 🔗 Related Questions What is the output: template vector filter(vector v,fun... What is the output: template constexpr auto makeArray()... What is the output: template struct IsIntegral{static c... 📚 Related Topic Introduction to C++ (187) Variables and Data Types (160) Operators in C++ (163)
69 Question 69 EN + हिं GB What is the output: template class Singleton{static T* inst; public: static T& get(){if(!inst) inst=new T; return *inst;} Singleton()=delete;}; template T* Singleton::inst=nullptr; struct Config{int x=42;}; cout<::get().x; IN आउटपुट क्या है: टेम्प्लेट क्लास सिंगलटन {स्टेटिक टी * इंस्टा; सार्वजनिक: स्थिर T& get(){if(!inst) inst=new T; वापसी *इंस्ट;} सिंगलटन()=हटाएं;}; टेम्पलेट T* सिंगलटन::inst=nullptr; struct कॉन्फ़िग {int x=42;}; अदालत A 42 42 C Compile error संकलन त्रुटि D Undefined अपरिभाषित ✅ Correct Answer: 💡 Explanation / व्याख्या Explanation (English) Config x=42. Output: 42. व्याख्या (हिन्दी) कॉन्फ़िग x=42. आउटपुट: 42. 🎯 Exam Perspective अगर आप UPSC, SSC, Banking और Police भर्ती की तैयारी कर रहे हैं, तो OOP Using C++ ("Templates" sub-topic) का यह topic आपके लिए महत्वपूर्ण है। Exam में accuracy बढ़ाने के लिए हर सवाल की explanation जरूर पढ़ें। 🔗 Related Questions What is the output: template T sq(T x){return x*x;} tem... What is the output: template T constexprMax(T a,T b){re... What is the output: template struct IsIntegral{static c... 📚 Related Topic Introduction to C++ (187) Variables and Data Types (160) Operators in C++ (163)
70 Question 70 EN + हिं GB What is the output: template constexpr int sumNT=(...+Ns); cout<; IN आउटपुट क्या है: template constexpr int sumNT=(...+Ns); अदालत A 15 15 B 5 5 C Compile error संकलन त्रुटि D Undefined अपरिभाषित ✅ Correct Answer: 💡 Explanation / व्याख्या Explanation (English) 1+2+3+4+5=15. Output: 15. व्याख्या (हिन्दी) 1+2+3+4+5=15. आउटपुट: 15. 🎯 Exam Perspective OOP Using C++ ("Templates" sub-topic) के इस प्रश्न को कई प्रतियोगी परीक्षाओं जैसे Railway, SSC, Banking और Defence परीक्षाओं में repeat होते देखा गया है। Concept clarity के लिए explanation section जरूर पढ़ें। 🔗 Related Questions What is the output: template T gcd(T a,T b){return b?gc... What is the output: template T lerp(T a,T b,double t){r... What is the output: template T constexprMax(T a,T b){re... 📚 Related Topic Introduction to C++ (187) Variables and Data Types (160) Operators in C++ (163)
71 Question 71 EN + हिं GB What is the output: template class TypeList{}; cout<,TypeList>; IN आउटपुट क्या है: टेम्पलेट क्लास टाइपलिस्ट{}; अदालत A 1 1 C Compile error संकलन त्रुटि D Undefined अपरिभाषित ✅ Correct Answer: 💡 Explanation / व्याख्या Explanation (English) Same template with same arg: same type. is_same=1. Output: 1. व्याख्या (हिन्दी) समान तर्क के साथ समान टेम्पलेट: समान प्रकार। समान=1 है. आउटपुट: 1. 🎯 Exam Perspective यह सवाल OOP Using C++ ("Templates" sub-topic) category का है, और SSC, Railway, Banking और State PCS के exam pattern में इस तरह के questions common हैं। Answer choose करने के बाद दिया गया explanation जरूर पढ़ें। 🔗 Related Questions What is the output: template T constexprMax(T a,T b){re... What is the output: template T gcd(T a,T b){return b?gc... What is the output: template int countIf(vector& v,Pred... 📚 Related Topic Introduction to C++ (187) Variables and Data Types (160) Operators in C++ (163)
72 Question 72 EN + हिं GB What is the output: template T constexprMax(T a,T b){return a>b?a:b;} constexpr int m=constexprMax(3,7); cout< IN आउटपुट क्या है: टेम्पलेट T constexprMax(T a,T b){return a>b?a:b;} constexpr int m=constexprMax(3,7); अदालत A 7 7 B 3 3 C Compile error संकलन त्रुटि D Undefined अपरिभाषित ✅ Correct Answer: 💡 Explanation / व्याख्या Explanation (English) constexprMax(3,7)=7. Output: 7. व्याख्या (हिन्दी) constexprMax(3,7)=7. आउटपुट: 7. 🎯 Exam Perspective यह प्रश्न OOP Using C++ ("Templates" sub-topic) की तैयारी करने वाले अभ्यर्थियों के लिए उपयोगी है। इस तरह के प्रश्न अक्सर SSC CGL, IBPS, RRB और State-level परीक्षाओं जैसी परीक्षाओं में पूछे जाते रहे हैं, इसलिए concept और explanation दोनों को ध्यान से समझें, सिर्फ उत्तर याद न करें। 🔗 Related Questions What is the output: template class Optional{bool has=fa... What is the output: template T myMin(T a,T b){return a What is the output: template T lerp(T a,T b,double t){r... 📚 Related Topic Introduction to C++ (187) Variables and Data Types (160) Operators in C++ (163)
73 Question 73 EN + हिं GB What is the output: template struct IsIntegral{static const bool v=false;}; template<> struct IsIntegral{static const bool v=true;}; template<> struct IsIntegral{static const bool v=true;}; cout<::v<::v<::v; IN आउटपुट क्या है: टेम्पलेट struct IsIntegral{static const bool v=false;}; टेम्पलेट संरचना IsIntegral{static const bool v=true;}; टेम्पलेट संरचना IsIntegral{static const bool v=true;}; अदालत A 101 101 B 010 010 C Compile error संकलन त्रुटि D Undefined अपरिभाषित ✅ Correct Answer: 💡 Explanation / व्याख्या Explanation (English) int=1, double=0, long=1. Output: 101. व्याख्या (हिन्दी) int=1, दोगुना=0, लंबा=1। आउटपुट: 101. 🎯 Exam Perspective OOP Using C++ ("Templates" sub-topic) से जुड़ा यह सवाल उन students के लिए काम का है जो UPSC, SSC, Banking और Police भर्ती की तैयारी कर रहे हैं। बेहतर होगा कि explanation पढ़कर concept clear करें, ताकि exam में similar प्रश्न आने पर confusion न हो। 🔗 Related Questions What is the output: template class TypeList{}; cout What is the output: template vector filter(vector v,fun... What is the output: template class Optional{bool has=fa... 📚 Related Topic Introduction to C++ (187) Variables and Data Types (160) Operators in C++ (163)
74 Question 74 EN + हिं GB What is the output: template auto zip(vectora,vectorb){vector>r;for(int i=0;i({1,2,3},{4,5,6}); cout< IN आउटपुट क्या है: टेम्पलेट ऑटो ज़िप(वेक्टोरा,वेक्टरबी){वेक्टर;for(int i=0;i A 25 25 B 14 14 C Compile error संकलन त्रुटि D Undefined अपरिभाषित ✅ Correct Answer: 💡 Explanation / व्याख्या Explanation (English) v[1]={2,5}. first=2, second=5. Output: 25. व्याख्या (हिन्दी) v[1]={2,5}. पहला=2, दूसरा=5. आउटपुट: 25. 🎯 Exam Perspective Railway, SSC, Banking और Defence परीक्षाओं जैसी परीक्षाओं में OOP Using C++ ("Templates" sub-topic) से सवाल अक्सर पूछे जाते हैं। इसलिए सिर्फ answer रटने के बजाय, नीचे दी गई explanation को ध्यान से पढ़ें और concept समझें। 🔗 Related Questions What is the output: template int countIf(vector& v,Pred... What is the output: template struct IsIntegral{static c... What is the output: template T constexprMax(T a,T b){re... 📚 Related Topic Introduction to C++ (187) Variables and Data Types (160) Operators in C++ (163)
75 Question 75 EN + हिं GB What is the output: template T sq(T x){return x*x;} template<> string sq(string s){return s+s;} cout< IN आउटपुट क्या है: टेम्पलेट T sq(T x){रिटर्न x*x;} टेम्पलेट स्ट्रिंग sq(स्ट्रिंग s){रिटर्न s+s;} कॉउट A 9abab 9बाबा B Compile error संकलन त्रुटि C Undefined अपरिभाषित D 9 abab 9 अबाब ✅ Correct Answer: 💡 Explanation / व्याख्या Explanation (English) sq(3)=9; sq("ab")="ab"+"ab"="abab". Output: 9abab. व्याख्या (हिन्दी) वर्ग(3)=9; sq('ab''='ab'+'ab'='abab''। आउटपुट: 9abab. 🎯 Exam Perspective अगर आप SSC, Railway, Banking और State PCS की तैयारी कर रहे हैं, तो OOP Using C++ ("Templates" sub-topic) का यह topic आपके लिए महत्वपूर्ण है। Exam में accuracy बढ़ाने के लिए हर सवाल की explanation जरूर पढ़ें। 🔗 Related Questions What is the output: template class Singleton{static T*... What is the output: template T myMin(T a,T b){return a What is the output: template constexpr int sumNT=(...+N... 📚 Related Topic Introduction to C++ (187) Variables and Data Types (160) Operators in C++ (163)