OOP Using C++ — MCQ Practice

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

📚 1915 Questions 🌐 Hindi + English ✅ Free
भाषा / Language:
1915 questions
1081
EN + हिं
GB What is the output: auto x=0xDEAD; cout<
IN आउटपुट क्या है: auto x=0xDEAD; अदालत
A
dead मृत
B
DEAD मृत
C
Compile error संकलन त्रुटि
D
Undefined अपरिभाषित
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) hex stream manipulator outputs lowercase. Output: dead.
व्याख्या (हिन्दी) हेक्स स्ट्रीम मैनिपुलेटर लोअरकेस आउटपुट देता है। आउटपुट: मृत.
1082
EN + हिं
GB What is 'std::jthread' stop_source?
IN 'std::jthread' stop_source क्या है?
A
Provides stop_token to request cooperative cancellation सहकारी रद्दीकरण का अनुरोध करने के लिए stop_token प्रदान करता है
B
Kills thread forcefully धागे को जबरदस्ती मारता है
C
Pauses thread थ्रेड को रोकता है
D
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() की जाँच करता है।
1083
EN + हिं
GB What is the output: int x=5; cout<<(x&(~0<<2));
IN आउटपुट क्या है: int x=5; अदालत
A
4 4
B
5 5
C
Compile error संकलन त्रुटि
D
Undefined अपरिभाषित
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) ~0<<2 = ...11111100. 5=101. 101&...100 = 100 = 4. Output: 4.
व्याख्या (हिन्दी) ~0
1084
EN + हिं
GB What is 'deducing this' (C++23)?
IN 'इसे घटाना' (C++23) क्या है?
A
Explicit this parameter: void f(this auto& self){} इस पैरामीटर को स्पष्ट करें: void f(this auto& self){}
B
New keyword नया कीवर्ड
C
CRTP replacement सीआरटीपी प्रतिस्थापन
D
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 इसका निष्कर्षण स्पष्ट स्व-पैरामीटर की अनुमति देता है, जिससे सरल सीआरटीपी और पुनरावर्ती लैम्ब्डा सक्षम होता है।
1085
EN + हिं
GB What is the output: int x=0b11110000; cout<<(x>>4&0xF);
IN आउटपुट क्या है: int x=0b11110000; cout4&0xF);
A
15 15
C
240 240
D
Compile error संकलन त्रुटि
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) 0xF0>>4=0x0F=15. 15&15=15. Output: 15.
व्याख्या (हिन्दी) 0xF0>>4=0x0F=15. 15&15=15. आउटपुट: 15.
1086
EN + हिं
GB What is 'std::mdspan'?
IN 'std::mdspan' क्या है?
A
Non-owning multidimensional array view (C++23) गैर-स्वामित्व वाला बहुआयामी सरणी दृश्य (C++23)
B
A matrix class एक मैट्रिक्स वर्ग
C
3D vector 3डी वेक्टर
D
Compile error संकलन त्रुटि
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) mdspan provides multidimensional indexing over contiguous data without owning it.
व्याख्या (हिन्दी) mdspan सन्निहित डेटा पर स्वामित्व के बिना बहुआयामी अनुक्रमण प्रदान करता है।
1087
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
A
Y वाई
B
Compile error संकलन त्रुटि
C
Undefined अपरिभाषित
D
Nothing कुछ नहीं
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) f(5)=120; static_assert passes; prints Y. Output: Y.
व्याख्या (हिन्दी) f(5)=120; static_assert पास; Y प्रिंट करता है। आउटपुट: Y।
1088
EN + हिं
GB What is 'std::print' in C++23?
IN C++23 में 'std::print' क्या है?
A
Type-safe formatted output (like Python print) टाइप-सुरक्षित स्वरूपित आउटपुट (पायथन प्रिंट की तरह)
B
Same as printf प्रिंटफ के समान
C
Deprecated cout पदावनत कोउट
D
A debug tool एक डिबग टूल
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) std::print("{}", 42) outputs formatted text; std::println adds newline.
व्याख्या (हिन्दी) std::print("{}", 42) स्वरूपित पाठ को आउटपुट करता है; std::println नई लाइन जोड़ता है।
1089
EN + हिं
GB What is the output: int x=255; cout<
IN आउटपुट क्या है: int x=255; अदालत
A
ff सीमांत बल
B
ff सीमांत बल
C
Compile error संकलन त्रुटि
D
Undefined अपरिभाषित
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) 255=0xFF. setw(8) pads to 8. Output: ff.
व्याख्या (हिन्दी) 255=0xFF. सेटडब्ल्यू(8) पैड से 8. आउटपुट: एफएफ।
1090
EN + हिं
GB What is 'std::flat_map' in C++23?
IN C++23 में 'std::flat_map' क्या है?
A
Sorted associative container stored in flat arrays (cache-friendly) समतल सरणियों में संग्रहित क्रमबद्ध सहयोगी कंटेनर (कैश-अनुकूल)
B
Same as std::map std::map के समान
C
Hash-based map हैश आधारित मानचित्र
D
Compile error संकलन त्रुटि
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) flat_map uses two sorted vectors for keys/values; better cache performance than node-based map.
व्याख्या (हिन्दी) फ़्लैट_मैप कुंजियों/मानों के लिए दो क्रमबद्ध वैक्टर का उपयोग करता है; नोड-आधारित मानचित्र की तुलना में बेहतर कैश प्रदर्शन।
1091
EN + हिं
GB What is the output: int x=5; cout<0)<<' '<<(x<0);
IN आउटपुट क्या है: int x=5; अदालत
A
true false सच्चा झूठ
B
1 0 1 0
C
Compile error संकलन त्रुटि
D
Undefined अपरिभाषित
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) boolalpha prints true/false. Output: true false.
व्याख्या (हिन्दी) बूलल्फा सही/गलत प्रिंट करता है। आउटपुट: सच्चा झूठ।
1092
EN + हिं
GB What is 'std::generator' in C++23?
IN C++23 में 'std::जनरेटर' क्या है?
A
Coroutine-based range generator कोरआउटिन-आधारित रेंज जनरेटर
B
A random number generator एक यादृच्छिक संख्या जनरेटर
C
An iterator एक पुनरावर्तक
D
A view एक दृश्य
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) std::generator is a coroutine type that yields values lazily via co_yield.
व्याख्या (हिन्दी) std::जनरेटर एक कोरआउटिन प्रकार है जो सह_यील्ड के माध्यम से आसानी से मान उत्पन्न करता है।
1093
EN + हिं
GB What is the output: int x=42; cout<
IN आउटपुट क्या है: int x=42; अदालत
A
52 2a 42 52 2ए 42
B
42 42 42 42 42 42
C
Compile error संकलन त्रुटि
D
Undefined अपरिभाषित
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) 42 in octal=52, hex=2a, dec=42. Output: 52 2a 42.
व्याख्या (हिन्दी) 42 में अष्टक=52, हेक्स=2ए, दशमांश=42। आउटपुट: 52 2ए 42।
1094
EN + हिं
GB What is 'ranges::to' in C++23?
IN C++23 में 'रेंज::टू' क्या है?
A
Converts a range to a container: views::filter(...)|ranges::to<vector>() किसी श्रेणी को कंटेनर में परिवर्तित करता है: view::filter(...)|ranges::to()
B
A cast एक निक्षेपण
C
A sort एक प्रकार
D
A view एक दृश्य
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) ranges::to materializes a lazy view into a concrete container.
व्याख्या (हिन्दी) रेंज::टू एक आलसी दृश्य को एक ठोस कंटेनर में बदल देता है।
1095
EN + हिं
GB What is the output: int x=5; cout<
IN आउटपुट क्या है: int x=5; अदालत
A
+5 -5 +5 -5
B
5 -5 5 -5
C
Compile error संकलन त्रुटि
D
Undefined अपरिभाषित
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) showpos shows + for positive. Output: +5 -5.
व्याख्या (हिन्दी) शोपोज़ सकारात्मक के लिए + दिखाता है। आउटपुट: +5 -5.
1081–1095 of 1915