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 91

EN + हिं
GB What is 'std::stop_token' in C++20?
IN C++20 में 'std::stop_token' क्या है?
Mechanism for cooperative thread cancellation सहकारी धागा रद्दीकरण के लिए तंत्र
A mutex एक म्यूटेक्स
An atomic flag एक परमाणु ध्वज
A future एक भविष्य
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) std::stop_token allows threads to check if cancellation was requested; used with std::jthread.
व्याख्या (हिन्दी) std::stop_token थ्रेड्स को यह जांचने की अनुमति देता है कि क्या रद्दीकरण का अनुरोध किया गया था; std::jthread के साथ प्रयोग किया जाता है।
🎯 Exam Perspective
OOP Using C++ ("Introduction to C++" sub-topic) से जुड़ा यह सवाल उन students के लिए काम का है जो SSC CGL, IBPS, RRB और State-level परीक्षाओं की तैयारी कर रहे हैं। बेहतर होगा कि explanation पढ़कर concept clear करें, ताकि exam में similar प्रश्न आने पर confusion न हो।

Question 92

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

Question 93

EN + हिं
GB What is 'std::coroutine_handle'?
IN 'std::coroutine_handle' क्या है?
Low-level handle to resume/destroy a suspended coroutine निलंबित कोरआउटिन को फिर से शुरू/नष्ट करने के लिए निम्न-स्तरीय हैंडल
A thread handle एक धागे का हैंडल
A future handle एक भविष्य का हैंडल
A fiber handle एक फाइबर हैंडल
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) std::coroutine_handle

wraps a coroutine frame pointer; .resume() continues execution from suspension point.

व्याख्या (हिन्दी) std::coroutine_handle एक coroutine फ़्रेम पॉइंटर को लपेटता है; .resume() निलंबन बिंदु से निष्पादन जारी रखता है।
🎯 Exam Perspective
अगर आप Railway, SSC, Banking और Defence परीक्षाओं की तैयारी कर रहे हैं, तो OOP Using C++ ("Introduction to C++" sub-topic) का यह topic आपके लिए महत्वपूर्ण है। Exam में accuracy बढ़ाने के लिए हर सवाल की explanation जरूर पढ़ें।

Question 94

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

Question 95

EN + हिं
GB What is the output: int x=5; cout<<(x+(x=10));
IN आउटपुट क्या है: int x=5; अदालत
Undefined behavior अपरिभाषित व्यवहार
15 15
20 20
Compile error संकलन त्रुटि
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) Reading x and assigning x in same expression without sequencing is UB.
व्याख्या (हिन्दी) x को पढ़ना और अनुक्रमण के बिना एक ही अभिव्यक्ति में x निर्दिष्ट करना UB है।
🎯 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 96

EN + हिं
GB What is 'std::execution::par' policy?
IN 'std::execution::par' नीति क्या है?
Parallel algorithm execution policy (C++17) समानांतर एल्गोरिथम निष्पादन नीति (C++17)
Sequential execution अनुक्रमिक निष्पादन
GPU execution जीपीयू निष्पादन
Thread pool only केवल थ्रेड पूल
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) std::sort(std::execution::par, ...) uses parallel execution if supported.
व्याख्या (हिन्दी) std::sort(std::execution::par, ...) यदि समर्थित हो तो समानांतर निष्पादन का उपयोग करता है।
🎯 Exam Perspective
यह प्रश्न OOP Using C++ ("Introduction to C++" sub-topic) की तैयारी करने वाले अभ्यर्थियों के लिए उपयोगी है। इस तरह के प्रश्न अक्सर UPSC, SSC, Banking और Police भर्ती जैसी परीक्षाओं में पूछे जाते रहे हैं, इसलिए concept और explanation दोनों को ध्यान से समझें, सिर्फ उत्तर याद न करें।

Question 97

EN + हिं
GB What is the output: cout<::min()+numeric_limits::max();
IN आउटपुट क्या है: cout
-1 -1
Undefined अपरिभाषित
Compile error संकलन त्रुटि
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) INT_MIN+INT_MAX = -2147483648+2147483647 = -1. Output: -1.
व्याख्या (हिन्दी) INT_MIN+INT_MAX = -2147483648+2147483647 = -1. आउटपुट:-1.
🎯 Exam Perspective
OOP Using C++ ("Introduction to C++" sub-topic) से जुड़ा यह सवाल उन students के लिए काम का है जो Railway, SSC, Banking और Defence परीक्षाओं की तैयारी कर रहे हैं। बेहतर होगा कि explanation पढ़कर concept clear करें, ताकि exam में similar प्रश्न आने पर confusion न हो।

Question 98

EN + हिं
GB What is the output: auto x=0xDEAD; cout<
IN आउटपुट क्या है: auto x=0xDEAD; अदालत
dead मृत
DEAD मृत
Compile error संकलन त्रुटि
Undefined अपरिभाषित
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) hex stream manipulator outputs lowercase. Output: dead.
व्याख्या (हिन्दी) हेक्स स्ट्रीम मैनिपुलेटर लोअरकेस आउटपुट देता है। आउटपुट: मृत.
🎯 Exam Perspective
SSC, Railway, Banking और State PCS जैसी परीक्षाओं में OOP Using C++ ("Introduction to C++" sub-topic) से सवाल अक्सर पूछे जाते हैं। इसलिए सिर्फ answer रटने के बजाय, नीचे दी गई explanation को ध्यान से पढ़ें और concept समझें।

Question 99

EN + हिं
GB What is 'std::jthread' stop_source?
IN 'std::jthread' stop_source क्या है?
Provides stop_token to request cooperative cancellation सहकारी रद्दीकरण का अनुरोध करने के लिए stop_token प्रदान करता है
Kills thread forcefully धागे को जबरदस्ती मारता है
Pauses thread थ्रेड को रोकता है
Same as mutex म्यूटेक्स के समान
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) stop_source::request_stop() signals stop_token; thread checks token.stop_requested().
व्याख्या (हिन्दी) stop_source::request_stop() सिग्नल stop_token; थ्रेड टोकन.stop_requested() की जाँच करता है।
🎯 Exam Perspective
अगर आप SSC CGL, IBPS, RRB और State-level परीक्षाओं की तैयारी कर रहे हैं, तो OOP Using C++ ("Introduction to C++" sub-topic) का यह topic आपके लिए महत्वपूर्ण है। Exam में accuracy बढ़ाने के लिए हर सवाल की explanation जरूर पढ़ें।

Question 100

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

Question 101

EN + हिं
GB What is 'deducing this' (C++23)?
IN 'इसे घटाना' (C++23) क्या है?
Explicit this parameter: void f(this auto& self){} इस पैरामीटर को स्पष्ट करें: void f(this auto& self){}
New keyword नया कीवर्ड
CRTP replacement सीआरटीपी प्रतिस्थापन
Both B and C बी और सी दोनों
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) C++23 deducing this allows explicit self parameter, enabling simpler CRTP and recursive lambdas.
व्याख्या (हिन्दी) C++23 इसका निष्कर्षण स्पष्ट स्व-पैरामीटर की अनुमति देता है, जिससे सरल सीआरटीपी और पुनरावर्ती लैम्ब्डा सक्षम होता है।
🎯 Exam Perspective
यह सवाल OOP Using C++ ("Introduction to C++" sub-topic) category का है, और Railway, SSC, Banking और Defence परीक्षाओं के exam pattern में इस तरह के questions common हैं। Answer choose करने के बाद दिया गया explanation जरूर पढ़ें।

Question 102

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

Question 103

EN + हिं
GB What is 'std::mdspan'?
IN 'std::mdspan' क्या है?
Non-owning multidimensional array view (C++23) गैर-स्वामित्व वाला बहुआयामी सरणी दृश्य (C++23)
A matrix class एक मैट्रिक्स वर्ग
3D vector 3डी वेक्टर
Compile error संकलन त्रुटि
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) mdspan provides multidimensional indexing over contiguous data without owning it.
व्याख्या (हिन्दी) mdspan सन्निहित डेटा पर स्वामित्व के बिना बहुआयामी अनुक्रमण प्रदान करता है।
🎯 Exam Perspective
OOP Using C++ ("Introduction to C++" sub-topic) से जुड़ा यह सवाल उन students के लिए काम का है जो SSC CGL, IBPS, RRB और State-level परीक्षाओं की तैयारी कर रहे हैं। बेहतर होगा कि explanation पढ़कर concept clear करें, ताकि exam में similar प्रश्न आने पर confusion न हो।

Question 104

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

Question 105

EN + हिं
GB What is 'std::print' in C++23?
IN C++23 में 'std::print' क्या है?
Type-safe formatted output (like Python print) टाइप-सुरक्षित स्वरूपित आउटपुट (पायथन प्रिंट की तरह)
Same as printf प्रिंटफ के समान
Deprecated cout पदावनत कोउट
A debug tool एक डिबग टूल
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) std::print("{}", 42) outputs formatted text; std::println adds newline.
व्याख्या (हिन्दी) std::print("{}", 42) स्वरूपित पाठ को आउटपुट करता है; std::println नई लाइन जोड़ता है।
🎯 Exam Perspective
अगर आप Railway, SSC, Banking और Defence परीक्षाओं की तैयारी कर रहे हैं, तो OOP Using C++ ("Introduction to C++" sub-topic) का यह topic आपके लिए महत्वपूर्ण है। Exam में accuracy बढ़ाने के लिए हर सवाल की explanation जरूर पढ़ें।