OOP Using C++ — MCQ Practice

Hindi aur English dono mein practice karo — click karo answer check karne ke liye.

📚 187 Questions 🌐 Hindi + English ✅ Free
भाषा / Language:
187 questions

Question 136

EN + हिं
GB What is the output: int x=42; cout<(x);
IN आउटपुट क्या है: int x=42; अदालत
00101010 00101010
42 42
Compile error संकलन त्रुटि
Undefined अपरिभाषित
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) 42=00101010 in binary. Output: 00101010.
व्याख्या (हिन्दी) 42=00101010 बाइनरी में। आउटपुट: 00101010.
🎯 Exam Perspective
OOP Using C++ ("Introduction to C++" sub-topic) के इस प्रश्न को कई प्रतियोगी परीक्षाओं जैसे UPSC, SSC, Banking और Police भर्ती में repeat होते देखा गया है। Concept clarity के लिए explanation section जरूर पढ़ें।

Question 137

EN + हिं
GB What is 'std::indirect' in C++26?
IN C++26 में 'std::indirect' क्या है?
Value-semantics smart pointer with deep copy डीप कॉपी के साथ वैल्यू-सिमेंटिक्स स्मार्ट पॉइंटर
Same as unique_ptr यूनिक_पीटीआर के समान
An optional एक वैकल्पिक
A reference wrapper एक संदर्भ आवरण
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) std::indirect provides value semantics with heap storage; copies deeply unlike shared_ptr.
व्याख्या (हिन्दी) std::indirect ढेर भंडारण के साथ मूल्य शब्दार्थ प्रदान करता है; Shared_ptr के विपरीत गहराई से प्रतिलिपियाँ।
🎯 Exam Perspective
यह सवाल OOP Using C++ ("Introduction to C++" sub-topic) category का है, और Railway, SSC, Banking और Defence परीक्षाओं के exam pattern में इस तरह के questions common हैं। Answer choose करने के बाद दिया गया explanation जरूर पढ़ें।

Question 138

EN + हिं
GB What is the output: int x=5,y=3; cout<
IN आउटपुट क्या है: int x=5,y=3; अदालत
1 15 1 15
5 3 5 3
Compile error संकलन त्रुटि
Undefined अपरिभाषित
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) gcd(5,3)=1; lcm(5,3)=15. Output: 1 15.
व्याख्या (हिन्दी) जीसीडी(5,3)=1; एलसीएम(5,3)=15. आउटपुट: 1 15.
🎯 Exam Perspective
यह प्रश्न OOP Using C++ ("Introduction to C++" sub-topic) की तैयारी करने वाले अभ्यर्थियों के लिए उपयोगी है। इस तरह के प्रश्न अक्सर SSC, Railway, Banking और State PCS जैसी परीक्षाओं में पूछे जाते रहे हैं, इसलिए concept और explanation दोनों को ध्यान से समझें, सिर्फ उत्तर याद न करें।

Question 139

EN + हिं
GB What is 'std::views::repeat' (C++23)?
IN 'std::views::repeat' (C++23) क्या है?
Creates infinite or bounded range of repeated value दोहराए गए मान की अनंत या बंधी हुई सीमा बनाता है
Same as fill भरने के समान
A cycle view एक चक्र दृश्य
A generate view एक उत्पन्न दृश्य
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) views::repeat(v) is infinite; views::repeat(v,n) repeats v exactly n times.
व्याख्या (हिन्दी) व्यूज::रिपीट(v) अनंत है; व्यूज::रिपीट(v,n) v को बिल्कुल n बार दोहराता है।
🎯 Exam Perspective
OOP Using C++ ("Introduction to C++" sub-topic) से जुड़ा यह सवाल उन students के लिए काम का है जो SSC CGL, IBPS, RRB और State-level परीक्षाओं की तैयारी कर रहे हैं। बेहतर होगा कि explanation पढ़कर concept clear करें, ताकि exam में similar प्रश्न आने पर confusion न हो।

Question 140

EN + हिं
GB What is the output: cout<<(1ull<<63);
IN आउटपुट क्या है: cout
9223372036854775808 9223372036854775808
Undefined अपरिभाषित
Compile error संकलन त्रुटि
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) 1ULL<<63 = 2^63 = 9223372036854775808. Output: 9223372036854775808.
व्याख्या (हिन्दी) 1ULL
🎯 Exam Perspective
UPSC, SSC, Banking और Police भर्ती जैसी परीक्षाओं में OOP Using C++ ("Introduction to C++" sub-topic) से सवाल अक्सर पूछे जाते हैं। इसलिए सिर्फ answer रटने के बजाय, नीचे दी गई explanation को ध्यान से पढ़ें और concept समझें।

Question 141

EN + हिं
GB What is 'std::format_to' vs 'std::format'?
IN 'std::format_to' बनाम 'std::format' क्या है?
format_to writes to output iterator; format returns string form_to आउटपुट इटरेटर को लिखता है; प्रारूप रिटर्न स्ट्रिंग
Same thing एक ही बात
format_to is faster form_to तेज़ है
format deprecated प्रारूप बहिष्कृत
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) std::format_to(back_inserter(s), "{}", 42) appends to s without creating temporary string.
व्याख्या (हिन्दी) std::format_to(back_inserter(s), "{}", 42) अस्थायी स्ट्रिंग बनाए बिना s में जुड़ जाता है।
🎯 Exam Perspective
अगर आप Railway, SSC, Banking और Defence परीक्षाओं की तैयारी कर रहे हैं, तो OOP Using C++ ("Introduction to C++" sub-topic) का यह topic आपके लिए महत्वपूर्ण है। Exam में accuracy बढ़ाने के लिए हर सवाल की explanation जरूर पढ़ें।

Question 142

EN + हिं
GB What is the output: string s; format_to(back_inserter(s),"{:05d}",42); cout<
IN आउटपुट क्या है: स्ट्रिंग एस; format_to(back_inserter(s),"{:05d}",42); अदालत
00042 00042
42 42
Compile error संकलन त्रुटि
Undefined अपरिभाषित
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) Format spec :05d: zero-pad to 5 digits. Output: 00042.
व्याख्या (हिन्दी) प्रारूप विशिष्टता: 05डी: शून्य-पैड से 5 अंक। आउटपुट: 00042.
🎯 Exam Perspective
OOP Using C++ ("Introduction to C++" sub-topic) के इस प्रश्न को कई प्रतियोगी परीक्षाओं जैसे SSC, Railway, Banking और State PCS में repeat होते देखा गया है। Concept clarity के लिए explanation section जरूर पढ़ें।

Question 143

EN + हिं
GB What is 'std::views::cartesian_product' (C++23)?
IN 'std::views::cartesian_product' (C++23) क्या है?
Yields all combinations from multiple ranges कई श्रेणियों से सभी संयोजन प्राप्त होते हैं
A zip view एक ज़िप दृश्य
A join view एक सम्मिलित दृश्य
A merge view एक मर्ज दृश्य
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) views::cartesian_product(r1,r2) yields (a,b) for all a in r1, b in r2.
व्याख्या (हिन्दी) view::cartesian_product(r1,r2) r1 में सभी a, r2 में b के लिए (a,b) उत्पन्न करता है।
🎯 Exam Perspective
यह सवाल OOP Using C++ ("Introduction to C++" sub-topic) category का है, और SSC CGL, IBPS, RRB और State-level परीक्षाओं के exam pattern में इस तरह के questions common हैं। Answer choose करने के बाद दिया गया explanation जरूर पढ़ें।

Question 144

EN + हिं
GB What is the output: auto v=vector{1,2,3,4,5}; auto r=v|views::filter([](int x){return x%2==0;})|views::transform([](int x){return x*x;}); for(int x:r) cout<
IN आउटपुट क्या है: ऑटो v=वेक्टर{1,2,3,4,5}; ऑटो r=v|व्यूज़::फ़िल्टर([](int x){रिटर्न x%2==0;})|व्यूज़::ट्रांसफ़ॉर्म([](int x){रिटर्न x*x;}); for(int x:r) कोउट
4 16 4 16
1 4 9 16 25 1 4 9 16 25
Compile error संकलन त्रुटि
Undefined अपरिभाषित
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) Evens: 2,4. Squares: 4,16. Output: 4 16.
व्याख्या (हिन्दी) शाम: 2,4. वर्ग: 4,16. आउटपुट: 4 16.
🎯 Exam Perspective
यह प्रश्न OOP Using C++ ("Introduction to C++" sub-topic) की तैयारी करने वाले अभ्यर्थियों के लिए उपयोगी है। इस तरह के प्रश्न अक्सर UPSC, SSC, Banking और Police भर्ती जैसी परीक्षाओं में पूछे जाते रहे हैं, इसलिए concept और explanation दोनों को ध्यान से समझें, सिर्फ उत्तर याद न करें।

Question 145

EN + हिं
GB What is 'std::views::join_with' (C++23)?
IN 'std::views::join_with' (C++23) क्या है?
Joins range of ranges with delimiter सीमांकक के साथ श्रेणियों की श्रेणी को जोड़ता है
Same as join सम्मिलित होने के समान
A string join एक तार जुड़ता है
A flatten एक चपटा
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) views::join_with(ranges_of_ranges, delim) concatenates with delimiter between groups.
व्याख्या (हिन्दी) view::join_with(ranges_of_ranges, delim) समूहों के बीच सीमांकक के साथ जुड़ता है।
🎯 Exam Perspective
OOP Using C++ ("Introduction to C++" sub-topic) से जुड़ा यह सवाल उन students के लिए काम का है जो Railway, SSC, Banking और Defence परीक्षाओं की तैयारी कर रहे हैं। बेहतर होगा कि explanation पढ़कर concept clear करें, ताकि exam में similar प्रश्न आने पर confusion न हो।

Question 146

EN + हिं
GB What is the output: consteval int sq(int x){return x*x;} cout<
IN आउटपुट क्या है: consteval int sq(int x){return x*x;} cout
49 49
7 7
Compile error संकलन त्रुटि
Undefined अपरिभाषित
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) consteval forces compile-time. sq(7)=49. Output: 49.
व्याख्या (हिन्दी) कॉन्स्टवल बल संकलन-समय। वर्ग(7)=49. आउटपुट: 49.
🎯 Exam Perspective
SSC, Railway, Banking और State PCS जैसी परीक्षाओं में OOP Using C++ ("Introduction to C++" sub-topic) से सवाल अक्सर पूछे जाते हैं। इसलिए सिर्फ answer रटने के बजाय, नीचे दी गई explanation को ध्यान से पढ़ें और concept समझें।

Question 147

EN + हिं
GB What is 'std::generator' usage?
IN 'std::जनरेटर' का उपयोग क्या है?
co_yield values lazily in a coroutine function कोरआउटिन फ़ंक्शन में सह-उपज मान आलसी हैं
A thread generator एक थ्रेड जनरेटर
Random generator यादृच्छिक जनरेटर
A factory एक कारखाना
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) generator g=[]()-> generator{ for(int i=0;;i++) co_yield i; }();
व्याख्या (हिन्दी) जनरेटर g=[]()-> जनरेटर{ for(int i=0;;i++) co_yield i; }();
🎯 Exam Perspective
अगर आप SSC CGL, IBPS, RRB और State-level परीक्षाओं की तैयारी कर रहे हैं, तो OOP Using C++ ("Introduction to C++" sub-topic) का यह topic आपके लिए महत्वपूर्ण है। Exam में accuracy बढ़ाने के लिए हर सवाल की explanation जरूर पढ़ें।

Question 148

EN + हिं
GB What is the output: int x=0; for(auto i:{1,2,3,4,5}) x+=i; cout<
IN आउटपुट क्या है: int x=0; for(ऑटो i:{1,2,3,4,5}) x+=i; अदालत
15 15
5 5
Compile error संकलन त्रुटि
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++ ("Introduction to C++" sub-topic) के इस प्रश्न को कई प्रतियोगी परीक्षाओं जैसे UPSC, SSC, Banking और Police भर्ती में repeat होते देखा गया है। Concept clarity के लिए explanation section जरूर पढ़ें।

Question 149

EN + हिं
GB What is 'std::move_sentinel' in C++20?
IN C++20 में 'std::move_sentinel' क्या है?
Sentinel adapter that allows move-only sentinel types सेंटिनल एडॉप्टर जो केवल-स्थानांतरित सेंटिनल प्रकारों की अनुमति देता है
Same as sentinel प्रहरी के समान
An end iterator एक अंतिम पुनरावर्तक
A predicate sentinel एक विधेय प्रहरी
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) move_sentinel wraps a sentinel so it can be used with move_iterator.
व्याख्या (हिन्दी) move_sentinel एक प्रहरी को लपेटता है ताकि इसका उपयोग move_iterator के साथ किया जा सके।
🎯 Exam Perspective
यह सवाल OOP Using C++ ("Introduction to C++" sub-topic) category का है, और Railway, SSC, Banking और Defence परीक्षाओं के exam pattern में इस तरह के questions common हैं। Answer choose करने के बाद दिया गया explanation जरूर पढ़ें।

Question 150

EN + हिं
GB What is the output: int x=5; string s=format("{:b}",x); cout<
IN आउटपुट क्या है: int x=5; स्ट्रिंग s=format("{:b}",x); अदालत
101 101
5 5
Compile error संकलन त्रुटि
Undefined अपरिभाषित
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) :b format spec outputs binary representation. 5=101. Output: 101.
व्याख्या (हिन्दी) :बी प्रारूप स्पेक बाइनरी प्रतिनिधित्व आउटपुट करता है। 5=101. आउटपुट: 101.
🎯 Exam Perspective
यह प्रश्न OOP Using C++ ("Introduction to C++" sub-topic) की तैयारी करने वाले अभ्यर्थियों के लिए उपयोगी है। इस तरह के प्रश्न अक्सर SSC, Railway, Banking और State PCS जैसी परीक्षाओं में पूछे जाते रहे हैं, इसलिए concept और explanation दोनों को ध्यान से समझें, सिर्फ उत्तर याद न करें।