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
1126
EN + हिं
GB What is 'std::views::cartesian_product' (C++23)?
IN 'std::views::cartesian_product' (C++23) क्या है?
A
Yields all combinations from multiple ranges कई श्रेणियों से सभी संयोजन प्राप्त होते हैं
B
A zip view एक ज़िप दृश्य
C
A join view एक सम्मिलित दृश्य
D
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) उत्पन्न करता है।
1127
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) कोउट
A
4 16 4 16
B
1 4 9 16 25 1 4 9 16 25
C
Compile error संकलन त्रुटि
D
Undefined अपरिभाषित
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) Evens: 2,4. Squares: 4,16. Output: 4 16.
व्याख्या (हिन्दी) शाम: 2,4. वर्ग: 4,16. आउटपुट: 4 16.
1128
EN + हिं
GB What is 'std::views::join_with' (C++23)?
IN 'std::views::join_with' (C++23) क्या है?
A
Joins range of ranges with delimiter सीमांकक के साथ श्रेणियों की श्रेणी को जोड़ता है
B
Same as join सम्मिलित होने के समान
C
A string join एक तार जुड़ता है
D
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) समूहों के बीच सीमांकक के साथ जुड़ता है।
1129
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
A
49 49
B
7 7
C
Compile error संकलन त्रुटि
D
Undefined अपरिभाषित
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) consteval forces compile-time. sq(7)=49. Output: 49.
व्याख्या (हिन्दी) कॉन्स्टवल बल संकलन-समय। वर्ग(7)=49. आउटपुट: 49.
1130
EN + हिं
GB What is 'std::generator' usage?
IN 'std::जनरेटर' का उपयोग क्या है?
A
co_yield values lazily in a coroutine function कोरआउटिन फ़ंक्शन में सह-उपज मान आलसी हैं
B
A thread generator एक थ्रेड जनरेटर
C
Random generator यादृच्छिक जनरेटर
D
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; }();
1131
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; अदालत
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.
1132
EN + हिं
GB What is 'std::move_sentinel' in C++20?
IN C++20 में 'std::move_sentinel' क्या है?
A
Sentinel adapter that allows move-only sentinel types सेंटिनल एडॉप्टर जो केवल-स्थानांतरित सेंटिनल प्रकारों की अनुमति देता है
B
Same as sentinel प्रहरी के समान
C
An end iterator एक अंतिम पुनरावर्तक
D
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 के साथ किया जा सके।
1133
EN + हिं
GB What is the output: int x=5; string s=format("{:b}",x); cout<
IN आउटपुट क्या है: int x=5; स्ट्रिंग s=format("{:b}",x); अदालत
A
101 101
B
5 5
C
Compile error संकलन त्रुटि
D
Undefined अपरिभाषित
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) :b format spec outputs binary representation. 5=101. Output: 101.
व्याख्या (हिन्दी) :बी प्रारूप स्पेक बाइनरी प्रतिनिधित्व आउटपुट करता है। 5=101. आउटपुट: 101.
1134
EN + हिं
GB What is 'std::ranges::iota' (C++23)?
IN 'std::ranges::iota' (C++23) क्या है?
A
Fills range with sequentially incrementing values क्रमिक रूप से बढ़ते मानों के साथ श्रेणी भरता है
B
Same as std::iota std::iota के समान
C
A view एक दृश्य
D
Both A and B ए और बी दोनों
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) ranges::iota is the range version; views::iota creates a lazy iota view.
व्याख्या (हिन्दी) रेंज::आईओटा रेंज संस्करण है; दृश्य::iota एक आलसी iota दृश्य बनाता है।
1135
EN + हिं
GB What is the output: auto v=views::iota(1,6)|views::transform([](int x){return x*x;}); cout<{});
IN आउटपुट क्या है: auto v=views::iota(1,6)|views::transform([](int x){return x*x;}); अदालत
A
55 55
B
15 15
C
Compile error संकलन त्रुटि
D
Undefined अपरिभाषित
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) 1+4+9+16+25=55. Output: 55.
व्याख्या (हिन्दी) 1+4+9+16+25=55. आउटपुट: 55.
1136
EN + हिं
GB What is 'std::ranges::fold_left' (C++23)?
IN 'std::ranges::fold_left' (C++23) क्या है?
A
Left fold over range with binary operation बाइनरी ऑपरेशन के साथ बाईं ओर की सीमा को मोड़ें
B
Same as accumulate संचय के समान
C
A reduce एक कमी
D
Both A and B ए और बी दोनों
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) ranges::fold_left(range,init,op) is equivalent to std::accumulate but works with ranges.
व्याख्या (हिन्दी) रेंज::फोल्ड_लेफ्ट(रेंज,इनिट,ऑप) std::accumute के बराबर है लेकिन रेंज के साथ काम करता है।
1137
EN + हिं
GB What is the output: int x=5; decltype(x) y=10; cout<
IN आउटपुट क्या है: int x=5; घोषणापत्र(x) y=10; अदालत
A
4 4
B
8 8
C
Compile error संकलन त्रुटि
D
Undefined अपरिभाषित
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) decltype(x)=int. sizeof(int)=4. Output: 4.
व्याख्या (हिन्दी) decltype(x)=int. sizeof(int)=4. आउटपुट: 4.
1138
EN + हिं
GB What is the output: auto x=1; auto y=2u; cout<<(x+y);
IN आउटपुट क्या है: ऑटो x=1; ऑटो y=2u; अदालत
A
3 3
B
Undefined अपरिभाषित
C
Compile error संकलन त्रुटि
D
-1 -1
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) x converted to unsigned; 1+2=3. Output: 3.
व्याख्या (हिन्दी) x को अहस्ताक्षरित में परिवर्तित किया गया; 1+2=3. आउटपुट: 3.
1139
EN + हिं
GB What is 'std::integral_constant'?
IN 'std::integral_constant' क्या है?
A
Compile-time constant value as a type एक प्रकार के रूप में संकलन-समय स्थिर मान
B
A runtime constant एक रनटाइम स्थिरांक
C
A variable template एक परिवर्तनीय टेम्पलेट
D
A typedef एक टाइपडिफ़
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) integral_constant::value=5; used in TMP to pass values as types.
व्याख्या (हिन्दी) अभिन्न_स्थिरांक::मान=5; TMP में मानों को प्रकारों के रूप में पारित करने के लिए उपयोग किया जाता है।
1140
EN + हिं
GB What is the output: constexpr auto x=1<=>2; cout<<(x<0);
IN आउटपुट क्या है: constexpr auto x=12; अदालत
A
1 1
C
Compile error संकलन त्रुटि
D
Undefined अपरिभाषित
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) 1<2 so strong_ordering::less < 0 = true = 1. Output: 1.
व्याख्या (हिन्दी) 1
1126–1140 of 1915