76 Question 76 EN + हिं GB What is the output: template struct Opt{bool h;T v; Opt():h(false){} Opt(T x):h(true),v(x){} T or_(T d){return h?v:d;}}; Opt a(5),b; cout< IN आउटपुट क्या है: टेम्पलेट स्ट्रक्चर ऑप्ट{बूल एच;टी वी; Opt():h(false){} Opt(T x):h(true),v(x){} T या_(T d){return h?v:d;}}; ऑप्ट ए(5),बी; अदालत A 599 599 B 50 50 C Compile error संकलन त्रुटि D Undefined अपरिभाषित ✅ Correct Answer: 💡 Explanation / व्याख्या Explanation (English) a has value 5; b empty. Output: 599. व्याख्या (हिन्दी) a का मान 5 है; बी खाली. आउटपुट: 599. 🎯 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 void swap3(T& a,T& b,T& c)... What is the output: template class Vec2{public:T x,y; V... What is the output: template bool same(T a,U b){return... 📚 Related Topic Introduction to C++ (187) Variables and Data Types (160) Operators in C++ (163)
77 Question 77 EN + हिं GB What is the output: template T myAbs(T x){return x<0?-x:x;} cout< IN आउटपुट क्या है: टेम्पलेट T myAbs(T x){रिटर्न x A 53.14 53.14 B 5 3 5 3 C Compile error संकलन त्रुटि D Undefined अपरिभाषित ✅ Correct Answer: 💡 Explanation / व्याख्या Explanation (English) 5 and 3.14. Output: 53.14. व्याख्या (हिन्दी) 5 और 3.14. आउटपुट: 53.14. 🎯 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 Vec2{public:T x,y; V... What is the output: template struct Zero{static constex... What is the output: template struct YN{static const cha... 📚 Related Topic Introduction to C++ (187) Variables and Data Types (160) Operators in C++ (163)
78 Question 78 EN + हिं GB What is the output: template bool same(T a,U b){return is_same_v&&a==b;} cout< IN आउटपुट क्या है: टेम्पलेट बूल समान(T a,U b){return is_same_v&&a==b;} cout A 10 10 B 11 11 C Compile error संकलन त्रुटि D Undefined अपरिभाषित ✅ Correct Answer: 💡 Explanation / व्याख्या Explanation (English) same(5,5): T=U=int, 5==5=1. same(5,5.0): T=int,U=double: is_same=false=0. Output: 10. व्याख्या (हिन्दी) वही(5,5): टी=यू=इंट, 5==5=1। समान(5,5.0): T=int,U=डबल: is_same=false=0. आउटपुट: 10. 🎯 Exam Perspective यह प्रश्न OOP Using C++ ("Templates" sub-topic) की तैयारी करने वाले अभ्यर्थियों के लिए उपयोगी है। इस तरह के प्रश्न अक्सर Railway, SSC, Banking और Defence परीक्षाओं जैसी परीक्षाओं में पूछे जाते रहे हैं, इसलिए concept और explanation दोनों को ध्यान से समझें, सिर्फ उत्तर याद न करें। 🔗 Related Questions What is the output: template struct Bits{static const i... What is the output: template T myAbs(T x){return x What is the output: template struct Zero{static constex... 📚 Related Topic Introduction to C++ (187) Variables and Data Types (160) Operators in C++ (163)
79 Question 79 EN + हिं GB What is the output: template struct Bits{static const int v=1<::v<::v<::v; IN आउटपुट क्या है: टेम्पलेट स्ट्रक्चर बिट्स {static const int v=1 A 1 8 128 1 8 128 B 18128 18128 C Compile error संकलन त्रुटि D Undefined अपरिभाषित ✅ Correct Answer: 💡 Explanation / व्याख्या Explanation (English) 1<<0=1; 1<<3=8; 1<<7=128. Output: 18128. व्याख्या (हिन्दी) 1 🎯 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 struct Neg{using type=T;};... What is the output: template struct Count{static const... What is the output: template bool same(T a,U b){return... 📚 Related Topic Introduction to C++ (187) Variables and Data Types (160) Operators in C++ (163)
80 Question 80 EN + हिं GB What is the output: template struct Neg{using type=T;}; template<> struct Neg{using type=unsigned;}; Neg::type x=-1; cout< IN आउटपुट क्या है: टेम्पलेट संरचना नकारात्मक{उपयोग प्रकार=टी;}; टेम्पलेट संरचना नकारात्मक{प्रकार का उपयोग करके=अहस्ताक्षरित;}; नकारात्मक::प्रकार x=-1; अदालत A 4294967295 4294967295 B -1 -1 C Compile error संकलन त्रुटि D Undefined अपरिभाषित ✅ Correct Answer: 💡 Explanation / व्याख्या Explanation (English) type=unsigned; unsigned x=-1=UINT_MAX. Output: 4294967295. व्याख्या (हिन्दी) प्रकार=अहस्ताक्षरित; अहस्ताक्षरित x=-1=UINT_MAX. आउटपुट: 4294967295. 🎯 Exam Perspective SSC CGL, IBPS, RRB और State-level परीक्षाओं जैसी परीक्षाओं में OOP Using C++ ("Templates" sub-topic) से सवाल अक्सर पूछे जाते हैं। इसलिए सिर्फ answer रटने के बजाय, नीचे दी गई explanation को ध्यान से पढ़ें और concept समझें। 🔗 Related Questions What is the output: template struct Constant{static con... What is the output: template struct Zero{static constex... What is the output: template T myAbs(T x){return x 📚 Related Topic Introduction to C++ (187) Variables and Data Types (160) Operators in C++ (163)
81 Question 81 EN + हिं GB What is the output: template struct Count{static const int v=sizeof...(Ts);}; cout<::v; IN आउटपुट क्या है: टेम्पलेट स्ट्रक्चर काउंट {static const int v=sizeof...(Ts);}; अदालत A 3 3 B 1 1 C Compile error संकलन त्रुटि D Undefined अपरिभाषित ✅ Correct Answer: 💡 Explanation / व्याख्या Explanation (English) sizeof...=3. Output: 3. व्याख्या (हिन्दी) आकार...=3. आउटपुट: 3. 🎯 Exam Perspective अगर आप UPSC, SSC, Banking और Police भर्ती की तैयारी कर रहे हैं, तो OOP Using C++ ("Templates" sub-topic) का यह topic आपके लिए महत्वपूर्ण है। Exam में accuracy बढ़ाने के लिए हर सवाल की explanation जरूर पढ़ें। 🔗 Related Questions What is the output: template struct Zero{static constex... What is the output: template class Vec2{public:T x,y; V... What is the output: template T dot(vectora,vectorb){T s... 📚 Related Topic Introduction to C++ (187) Variables and Data Types (160) Operators in C++ (163)
82 Question 82 EN + हिं GB What is the output: template T mid(T a,T b,T c){T s[]={a,b,c};sort(s,s+3);return s[1];}cout< IN आउटपुट क्या है: टेम्पलेट टी मिड(टी ए,टी बी,टी सी){टी एस[]={ए,बी,सी};सॉर्ट(एस,एस+3);रिटर्न एस[1];}काउट A 5 5 B 7 7 C Compile error संकलन त्रुटि D Undefined अपरिभाषित ✅ Correct Answer: 💡 Explanation / व्याख्या Explanation (English) Sorted: 3,5,7. Middle=5. Output: 5. व्याख्या (हिन्दी) क्रमबद्ध: 3,5,7. मध्य=5. आउटपुट: 5. 🎯 Exam Perspective OOP Using C++ ("Templates" sub-topic) के इस प्रश्न को कई प्रतियोगी परीक्षाओं जैसे Railway, SSC, Banking और Defence परीक्षाओं में repeat होते देखा गया है। Concept clarity के लिए explanation section जरूर पढ़ें। 🔗 Related Questions What is the output: template struct Neg{using type=T;};... What is the output: template T myAbs(T x){return x What is the output: template struct Opt{bool h;T v; Opt... 📚 Related Topic Introduction to C++ (187) Variables and Data Types (160) Operators in C++ (163)
83 Question 83 EN + हिं GB What is the output: template struct YN{static const char v='N';}; template<> struct YN{static const char v='Y';}; cout<1)>::v; IN आउटपुट क्या है: टेम्पलेट struct YN{static const char v='N';}; टेम्पलेट संरचना YN{static const char v='Y';}; अदालत A Y वाई B N एन C Compile error संकलन त्रुटि D Undefined अपरिभाषित ✅ Correct Answer: 💡 Explanation / व्याख्या Explanation (English) 2>1=true: YN::v='Y'. Output: Y. व्याख्या (हिन्दी) 2>1=सत्य: YN::v='Y'। आउटपुट: वाई. 🎯 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 mid(T a,T b,T c){T s[]={... What is the output: template T myAbs(T x){return x What is the output: template class Vec2{public:T x,y; V... 📚 Related Topic Introduction to C++ (187) Variables and Data Types (160) Operators in C++ (163)
84 Question 84 EN + हिं GB What is the output: template struct Zero{static constexpr T v=T{};}; cout<::v<::v<::v; IN आउटपुट क्या है: टेम्पलेट struct Zero{static constexpr T v=T{};}; अदालत A 000 000 B 010 010 C Compile error संकलन त्रुटि D Undefined अपरिभाषित ✅ Correct Answer: 💡 Explanation / व्याख्या Explanation (English) int{}=0, double{}=0, bool{}=false=0. Output: 000. व्याख्या (हिन्दी) int{}=0, डबल{}=0, बूल{}=झूठा=0। आउटपुट: 000. 🎯 Exam Perspective यह प्रश्न OOP Using C++ ("Templates" sub-topic) की तैयारी करने वाले अभ्यर्थियों के लिए उपयोगी है। इस तरह के प्रश्न अक्सर SSC CGL, IBPS, RRB और State-level परीक्षाओं जैसी परीक्षाओं में पूछे जाते रहे हैं, इसलिए concept और explanation दोनों को ध्यान से समझें, सिर्फ उत्तर याद न करें। 🔗 Related Questions What is the output: template class Vec2{public:T x,y; V... What is the output: template struct Neg{using type=T;};... What is the output: template struct Count{static const... 📚 Related Topic Introduction to C++ (187) Variables and Data Types (160) Operators in C++ (163)
85 Question 85 EN + हिं GB What is the output: template struct Constant{static constexpr T value=V;}; using Five=Constant; cout< IN आउटपुट क्या है: टेम्प्लेट स्ट्रक्चर कॉन्स्टैंट {स्थैतिक कॉन्स्टेक्सपीआर टी वैल्यू = वी;}; पाँच=स्थिरांक का उपयोग करना; अदालत A 5 5 C Compile error संकलन त्रुटि D Undefined अपरिभाषित ✅ Correct Answer: 💡 Explanation / व्याख्या Explanation (English) Five::value=5. Output: 5. व्याख्या (हिन्दी) पाँच::मान=5. आउटपुट: 5. 🎯 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 struct IsSame{template sta... What is the output: template struct Neg{using type=T;};... What is the output: template struct Zero{static constex... 📚 Related Topic Introduction to C++ (187) Variables and Data Types (160) Operators in C++ (163)
86 Question 86 EN + हिं GB What is the output: template T dot(vectora,vectorb){T s=T{};for(int i=0;i({1,2,3},{4,5,6}); IN आउटपुट क्या है: टेम्पलेट T dot(vectora,vectorb){T s=T{};for(int i=0;i A 32 32 B 15 15 C Compile error संकलन त्रुटि D Undefined अपरिभाषित ✅ Correct Answer: 💡 Explanation / व्याख्या Explanation (English) 1*4+2*5+3*6=32. Output: 32. व्याख्या (हिन्दी) 1*4+2*5+3*6=32. आउटपुट: 32. 🎯 Exam Perspective Railway, SSC, Banking और Defence परीक्षाओं जैसी परीक्षाओं में OOP Using C++ ("Templates" sub-topic) से सवाल अक्सर पूछे जाते हैं। इसलिए सिर्फ answer रटने के बजाय, नीचे दी गई explanation को ध्यान से पढ़ें और concept समझें। 🔗 Related Questions What is the output: template struct Constant{static con... What is the output: template void swap3(T& a,T& b,T& c)... What is the output: template class Vec2{public:T x,y; V... 📚 Related Topic Introduction to C++ (187) Variables and Data Types (160) Operators in C++ (163)
87 Question 87 EN + हिं GB What is the output: template struct IsSame{template static bool f(){return false;} template<> static bool f(){return true;}}; cout<::f()<::f(); IN आउटपुट क्या है: टेम्प्लेट स्ट्रक्चर IsSame{टेम्पलेट स्टैटिक बूल f(){रिटर्न फॉल्स;} टेम्प्लेट स्टैटिक बूल f(){रिटर्न ट्रू;}}; अदालत A Compile error संकलन त्रुटि B 10 10 C 11 11 D Undefined अपरिभाषित ✅ Correct Answer: 💡 Explanation / व्याख्या Explanation (English) Explicit specialization of member template inside class body is not allowed. Compile error. व्याख्या (हिन्दी) क्लास बॉडी के अंदर सदस्य टेम्पलेट की स्पष्ट विशेषज्ञता की अनुमति नहीं है। संकलन त्रुटि. 🎯 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 Vec2{public:T x,y; V... What is the output: template struct Constant{static con... What is the output: template T mid(T a,T b,T c){T s[]={... 📚 Related Topic Introduction to C++ (187) Variables and Data Types (160) Operators in C++ (163)
88 Question 88 EN + हिं GB What is the output: template struct Add{static const int v=A+B;}; cout<::v; IN आउटपुट क्या है: टेम्पलेट संरचना जोड़ें{static const int v=A+B;}; अदालत A 30 30 B 10 10 C Compile error संकलन त्रुटि D Undefined अपरिभाषित ✅ Correct Answer: 💡 Explanation / व्याख्या Explanation (English) 10+20=30. Output: 30. व्याख्या (हिन्दी) 10+20=30. आउटपुट: 30. 🎯 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 struct Zero{static constex... What is the output: template struct YN{static const cha... What is the output: template class Vec2{public:T x,y; V... 📚 Related Topic Introduction to C++ (187) Variables and Data Types (160) Operators in C++ (163)
89 Question 89 EN + हिं GB What is the output: template void swap3(T& a,T& b,T& c){T t=a;a=b;b=c;c=t;} int x=1,y=2,z=3; swap3(x,y,z); cout< IN आउटपुट क्या है: टेम्पलेट void swim3(T& a,T& b,T& c){T t=a;a=b;b=c;c=t;} int x=1,y=2,z=3; स्वैप3(x,y,z); अदालत A 231 231 B 123 123 C Compile error संकलन त्रुटि D Undefined अपरिभाषित ✅ Correct Answer: 💡 Explanation / व्याख्या Explanation (English) a=b=2; b=c=3; c=t=1. x=2,y=3,z=1. Output: 231. व्याख्या (हिन्दी) ए=बी=2; बी=सी=3; सी=टी=1. x=2,y=3,z=1. आउटपुट: 231. 🎯 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 struct Constant{static con... What is the output: template class Vec2{public:T x,y; V... What is the output: template bool same(T a,U b){return... 📚 Related Topic Introduction to C++ (187) Variables and Data Types (160) Operators in C++ (163)
90 Question 90 EN + हिं GB What is the output: template class Vec2{public:T x,y; Vec2(T a,T b):x(a),y(b){} T dot(Vec2 o){return x*o.x+y*o.y;}}; Vec2a(1,2),b(3,4); cout< IN आउटपुट क्या है: टेम्पलेट क्लास Vec2{public:T x,y; Vec2(T a,T b):x(a),y(b){} T dot(Vec2 o){return x*o.x+y*o.y;}}; Vec2a(1,2),b(3,4); अदालत A 11 11 B 10 10 C Compile error संकलन त्रुटि D Undefined अपरिभाषित ✅ Correct Answer: 💡 Explanation / व्याख्या Explanation (English) 1*3+2*4=11. Output: 11. व्याख्या (हिन्दी) 1*3+2*4=11. आउटपुट: 11. 🎯 Exam Perspective यह प्रश्न OOP Using C++ ("Templates" sub-topic) की तैयारी करने वाले अभ्यर्थियों के लिए उपयोगी है। इस तरह के प्रश्न अक्सर Railway, SSC, Banking और Defence परीक्षाओं जैसी परीक्षाओं में पूछे जाते रहे हैं, इसलिए concept और explanation दोनों को ध्यान से समझें, सिर्फ उत्तर याद न करें। 🔗 Related Questions What is the output: template struct IsSame{template sta... What is the output: template bool same(T a,U b){return... What is the output: template struct Count{static const... 📚 Related Topic Introduction to C++ (187) Variables and Data Types (160) Operators in C++ (163)