OOP Using C++ — MCQ Practice

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

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

Question 46

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

Question 47

EN + हिं
GB What is the output: int a[]={2,4,6,8,10}; cout<());
IN आउटपुट क्या है: int a[]={2,4,6,8,10}; अदालत
3840 3840
30 30
Compile error संकलन त्रुटि
Undefined अपरिभाषित
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) 2*4*6*8*10=3840. Output: 3840.
व्याख्या (हिन्दी) 2*4*6*8*10=3840. आउटपुट: 3840.
🎯 Exam Perspective
यह सवाल OOP Using C++ ("Arrays" sub-topic) category का है, और Railway, SSC, Banking और Defence परीक्षाओं के exam pattern में इस तरह के questions common हैं। Answer choose करने के बाद दिया गया explanation जरूर पढ़ें।

Question 48

EN + हिं
GB What is the output: int a[5]={1,2,3,4,5}; reverse_copy(a,a+5,ostream_iterator(cout));
IN आउटपुट क्या है: int a[5]={1,2,3,4,5}; रिवर्स_कॉपी(ए,ए+5,ओस्ट्रीम_इटरेटर(काउट));
54321 54321
12345 12345
Compile error संकलन त्रुटि
Undefined अपरिभाषित
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) Copies reversed: 5,4,3,2,1. Output: 54321.
व्याख्या (हिन्दी) प्रतियाँ उलटी: 5,4,3,2,1. आउटपुट: 54321.
🎯 Exam Perspective
यह प्रश्न OOP Using C++ ("Arrays" sub-topic) की तैयारी करने वाले अभ्यर्थियों के लिए उपयोगी है। इस तरह के प्रश्न अक्सर SSC, Railway, Banking और State PCS जैसी परीक्षाओं में पूछे जाते रहे हैं, इसलिए concept और explanation दोनों को ध्यान से समझें, सिर्फ उत्तर याद न करें।

Question 49

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

Question 50

EN + हिं
GB What is the output: int a[]={1,2,3,4,5}; auto it=find_if_not(a,a+5,[](int x){return x<4;}); cout<<*it;
IN आउटपुट क्या है: int a[]={1,2,3,4,5}; स्वतः it=find_if_not(a,a+5,[](int x){return x
4 4
5 5
3 3
Compile error संकलन त्रुटि
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) First element not <4 is 4. Output: 4.
व्याख्या (हिन्दी) पहला तत्व नहीं
🎯 Exam Perspective
UPSC, SSC, Banking और Police भर्ती जैसी परीक्षाओं में OOP Using C++ ("Arrays" sub-topic) से सवाल अक्सर पूछे जाते हैं। इसलिए सिर्फ answer रटने के बजाय, नीचे दी गई explanation को ध्यान से पढ़ें और concept समझें।

Question 51

EN + हिं
GB What is the output: int a[5]={1,2,3,4,5}; copy_if(a,a+5,ostream_iterator(cout),[](int x){return x%2!=0;});
IN आउटपुट क्या है: int a[5]={1,2,3,4,5}; Copy_if(a,a+5,ostream_iterator(cout),[](int x){return x%2!=0;});
135 135
24 24
Compile error संकलन त्रुटि
Undefined अपरिभाषित
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) Copies 1,3,5. Output: 135.
व्याख्या (हिन्दी) प्रतिलिपियाँ 1,3,5. आउटपुट: 135.
🎯 Exam Perspective
अगर आप Railway, SSC, Banking और Defence परीक्षाओं की तैयारी कर रहे हैं, तो OOP Using C++ ("Arrays" sub-topic) का यह topic आपके लिए महत्वपूर्ण है। Exam में accuracy बढ़ाने के लिए हर सवाल की explanation जरूर पढ़ें।

Question 52

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

Question 53

EN + हिं
GB What is the output: int a[]={1,2,3,4,5}; cout<
IN आउटपुट क्या है: int a[]={1,2,3,4,5}; अदालत
1 1
Compile error संकलन त्रुटि
Undefined अपरिभाषित
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) Comparing array to itself: all equal. Output: 1.
व्याख्या (हिन्दी) सरणी की स्वयं से तुलना करना: सभी समान। आउटपुट: 1.
🎯 Exam Perspective
यह सवाल OOP Using C++ ("Arrays" sub-topic) category का है, और SSC CGL, IBPS, RRB और State-level परीक्षाओं के exam pattern में इस तरह के questions common हैं। Answer choose करने के बाद दिया गया explanation जरूर पढ़ें।

Question 54

EN + हिं
GB What is the output: int a[]={1,2,3}; int b[]={1,2,3}; cout<
IN आउटपुट क्या है: int a[]={1,2,3}; int b[]={1,2,3}; अदालत
1 1
Compile error संकलन त्रुटि
Undefined अपरिभाषित
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) All elements equal. Output: 1.
व्याख्या (हिन्दी) सभी तत्व समान हैं. आउटपुट: 1.
🎯 Exam Perspective
यह प्रश्न OOP Using C++ ("Arrays" sub-topic) की तैयारी करने वाले अभ्यर्थियों के लिए उपयोगी है। इस तरह के प्रश्न अक्सर UPSC, SSC, Banking और Police भर्ती जैसी परीक्षाओं में पूछे जाते रहे हैं, इसलिए concept और explanation दोनों को ध्यान से समझें, सिर्फ उत्तर याद न करें।

Question 55

EN + हिं
GB What is the output: int a[]={1,2,3,4,5}; cout<
IN आउटपुट क्या है: int a[]={1,2,3,4,5}; अदालत
1 1
Compile error संकलन त्रुटि
Undefined अपरिभाषित
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) a[0]=1 vs a[1]=2: mismatch at first element. first=a. distance=0. Output: 0.
व्याख्या (हिन्दी) a[0]=1 बनाम a[1]=2: पहले तत्व पर बेमेल। प्रथम=ए. दूरी=0. आउटपुट: 0.
🎯 Exam Perspective
OOP Using C++ ("Arrays" sub-topic) से जुड़ा यह सवाल उन students के लिए काम का है जो Railway, SSC, Banking और Defence परीक्षाओं की तैयारी कर रहे हैं। बेहतर होगा कि explanation पढ़कर concept clear करें, ताकि exam में similar प्रश्न आने पर confusion न हो।

Question 56

EN + हिं
GB What is the output: int a[]={1,2,3,4,5}; adjacent_difference(a,a+5,a); for(int x:a) cout<
IN आउटपुट क्या है: int a[]={1,2,3,4,5}; आसन्न_अंतर(ए,ए+5,ए); for(int x:a) कोउट
11111 11111
12345 12345
Compile error संकलन त्रुटि
Undefined अपरिभाषित
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) 1,2-1=1,3-2=1,4-3=1,5-4=1. Output: 11111.
व्याख्या (हिन्दी) 1,2-1=1,3-2=1,4-3=1,5-4=1. आउटपुट: 11111.
🎯 Exam Perspective
SSC, Railway, Banking और State PCS जैसी परीक्षाओं में OOP Using C++ ("Arrays" sub-topic) से सवाल अक्सर पूछे जाते हैं। इसलिए सिर्फ answer रटने के बजाय, नीचे दी गई explanation को ध्यान से पढ़ें और concept समझें।

Question 57

EN + हिं
GB What is the output: int a[5]={0}; generate_n(a,5,[n=1]()mutable{return n++;});cout<
IN आउटपुट क्या है: int a[5]={0}; generate_n(a,5,[n=1]()mutable{return n++;});cout
5 5
4 4
Compile error संकलन त्रुटि
Undefined अपरिभाषित
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) a={1,2,3,4,5}. a[4]=5. Output: 5.
व्याख्या (हिन्दी) ए={1,2,3,4,5}। ए[4]=5. आउटपुट: 5.
🎯 Exam Perspective
अगर आप SSC CGL, IBPS, RRB और State-level परीक्षाओं की तैयारी कर रहे हैं, तो OOP Using C++ ("Arrays" sub-topic) का यह topic आपके लिए महत्वपूर्ण है। Exam में accuracy बढ़ाने के लिए हर सवाल की explanation जरूर पढ़ें।

Question 58

EN + हिं
GB What is the output: vector v={1,2,3,4,5}; rotate(v.begin(),v.begin()+3,v.end()); cout<
IN आउटपुट क्या है: वेक्टर v={1,2,3,4,5}; रोटेट(v.begin(),v.begin()+3,v.end()); अदालत
41 41
14 14
Compile error संकलन त्रुटि
Undefined अपरिभाषित
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) After rotate: {4,5,1,2,3}. v[0]=4,v[4]=3. Output: 43.
व्याख्या (हिन्दी) घुमाने के बाद: {4,5,1,2,3}। v[0]=4,v[4]=3. आउटपुट: 43.
🎯 Exam Perspective
OOP Using C++ ("Arrays" sub-topic) के इस प्रश्न को कई प्रतियोगी परीक्षाओं जैसे UPSC, SSC, Banking और Police भर्ती में repeat होते देखा गया है। Concept clarity के लिए explanation section जरूर पढ़ें।

Question 59

EN + हिं
GB What is the output: int a[]={1,2,3,4,5,4,3,2,1}; sort(a,a+9); cout<<*upper_bound(a,a+9,3);
IN आउटपुट क्या है: int a[]={1,2,3,4,5,4,3,2,1}; क्रमबद्ध करें(ए,ए+9); अदालत
4 4
3 3
Compile error संकलन त्रुटि
Undefined अपरिभाषित
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) Sorted: 1,1,2,2,3,3,4,4,5. upper_bound(3) points to first 4. Output: 4.
व्याख्या (हिन्दी) क्रमबद्ध: 1,1,2,2,3,3,4,4,5। अपर_बाउंड(3) पहले 4 की ओर इशारा करता है। आउटपुट: 4।
🎯 Exam Perspective
यह सवाल OOP Using C++ ("Arrays" sub-topic) category का है, और Railway, SSC, Banking और Defence परीक्षाओं के exam pattern में इस तरह के questions common हैं। Answer choose करने के बाद दिया गया explanation जरूर पढ़ें।

Question 60

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