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
721
EN + हिं
GB What is the output: vector v={1,2,3}; v.push_back(4); v.insert(v.begin(),0); cout<
IN आउटपुट क्या है: वेक्टर v={1,2,3}; v.push_back(4); v.insert(v.begin(),0); अदालत
A
50 50
B
40 40
C
Compile error संकलन त्रुटि
D
Undefined अपरिभाषित
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) Size=5 (0,1,2,3,4). v[0]=0. Output: 50.
व्याख्या (हिन्दी) आकार=5 (0,1,2,3,4). वी[0]=0. आउटपुट: 50.
722
EN + हिं
GB What is the output: int a[]={1,2,3,4,5}; cout<<*min_element(a,a+5);
IN आउटपुट क्या है: int a[]={1,2,3,4,5}; अदालत
A
1 1
B
5 5
C
Compile error संकलन त्रुटि
D
Undefined अपरिभाषित
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) min=1. Output: 1.
व्याख्या (हिन्दी) मिनट=1. आउटपुट: 1.
723
EN + हिं
GB What is the output: int a[4]={4,3,2,1}; sort(a,a+4); cout<
IN आउटपुट क्या है: int a[4]={4,3,2,1}; सॉर्ट करें (ए,ए+4); अदालत
A
14 14
B
41 41
C
Compile error संकलन त्रुटि
D
Undefined अपरिभाषित
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) Sorted: 1,2,3,4. a[0]=1,a[3]=4. Output: 14.
व्याख्या (हिन्दी) क्रमबद्ध: 1,2,3,4. ए[0]=1,ए[3]=4. आउटपुट: 14.
724
EN + हिं
GB What is the output: vector v={1,2,3,4,5}; v.erase(remove_if(v.begin(),v.end(),[](int x){return x%2==0;}),v.end()); cout<
IN आउटपुट क्या है: वेक्टर v={1,2,3,4,5}; v.erase(remove_if(v.begin(),v.end(),[](int x){return x%2==0;}),v.end()); अदालत
A
3 3
B
2 2
C
Compile error संकलन त्रुटि
D
Undefined अपरिभाषित
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) Removes 2,4. Remaining: 1,3,5. size=3. Output: 3.
व्याख्या (हिन्दी) 2,4 को हटाता है। शेष: 1,3,5. आकार=3. आउटपुट: 3.
725
EN + हिं
GB What is the output: int a[3][2]={{1,2},{3,4},{5,6}}; cout<
IN आउटपुट क्या है: int a[3][2]={{1,2},{3,4},{5,6}}; अदालत
A
7 7
B
6 6
C
Compile error संकलन त्रुटि
D
Undefined अपरिभाषित
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) 5+2=7. Output: 7.
व्याख्या (हिन्दी) 5+2=7. आउटपुट: 7.
726
EN + हिं
GB What is the output: int a[]={3,1,4,1,5,9,2,6}; sort(a,a+8); cout<
IN आउटपुट क्या है: int a[]={3,1,4,1,5,9,2,6}; क्रमबद्ध करें(ए,ए+8); अदालत
A
4 4
B
5 5
C
3 3
D
Compile error संकलन त्रुटि
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) Sorted: 1,1,2,3,4,5,6,9. a[4]=4. Output: 4.
व्याख्या (हिन्दी) क्रमबद्ध: 1,1,2,3,4,5,6,9। ए[4]=4. आउटपुट: 4.
727
EN + हिं
GB What is the output: int a[]={1,2,3,4,5}; for_each(a,a+5,[](int x){cout<
IN आउटपुट क्या है: int a[]={1,2,3,4,5}; for_each(a,a+5,[](int x){cout
A
1 4 9 16 25 1 4 9 16 25
B
149 1625 149 1625
C
Compile error संकलन त्रुटि
D
Undefined अपरिभाषित
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) 1,4,9,16,25 concatenated. Output: 149 1625.
व्याख्या (हिन्दी) 1,4,9,16,25 संयोजित। आउटपुट: 149 1625.
728
EN + हिं
GB What is the output: int a[]={1,2,3,4,5}; cout<3;});
IN आउटपुट क्या है: int a[]={1,2,3,4,5}; अदालत
A
2 2
B
3 3
C
Compile error संकलन त्रुटि
D
Undefined अपरिभाषित
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) 4 and 5 are >3. count=2. Output: 2.
व्याख्या (हिन्दी) 4 और 5 >3 हैं। गिनती=2. आउटपुट: 2.
729
EN + हिं
GB What is the output: vector v={5,3,8,1,9,2}; nth_element(v.begin(),v.begin()+2,v.end()); cout<
IN आउटपुट क्या है: वेक्टर v={5,3,8,1,9,2}; nth_element(v.begin(),v.begin()+2,v.end()); अदालत
A
3 3
B
5 5
C
Compile error संकलन त्रुटि
D
Undefined अपरिभाषित
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) Sorted: 1,2,3,5,8,9. 3rd(index 2)=3. Output: 3.
व्याख्या (हिन्दी) क्रमबद्ध: 1,2,3,5,8,9. तीसरा(सूचकांक 2)=3. आउटपुट: 3.
730
EN + हिं
GB What is the output: int a[]={1,3,5,7,9}; cout<<*lower_bound(a,a+5,6);
IN आउटपुट क्या है: int a[]={1,3,5,7,9}; अदालत
A
7 7
B
5 5
C
Compile error संकलन त्रुटि
D
Undefined अपरिभाषित
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) First element >= 6 is 7. Output: 7.
व्याख्या (हिन्दी) पहला तत्व >= 6, 7 है। आउटपुट: 7।
731
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
A
51 51
B
15 15
C
Compile error संकलन त्रुटि
D
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.
732
EN + हिं
GB What is the output: int a[]={2,4,6,8,10}; cout<());
IN आउटपुट क्या है: int a[]={2,4,6,8,10}; अदालत
A
3840 3840
B
30 30
C
Compile error संकलन त्रुटि
D
Undefined अपरिभाषित
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) 2*4*6*8*10=3840. Output: 3840.
व्याख्या (हिन्दी) 2*4*6*8*10=3840. आउटपुट: 3840.
733
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,ओस्ट्रीम_इटरेटर(काउट));
A
54321 54321
B
12345 12345
C
Compile error संकलन त्रुटि
D
Undefined अपरिभाषित
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) Copies reversed: 5,4,3,2,1. Output: 54321.
व्याख्या (हिन्दी) प्रतियाँ उलटी: 5,4,3,2,1. आउटपुट: 54321.
734
EN + हिं
GB What is 'std::mdspan' in C++23?
IN C++23 में 'std::mdspan' क्या है?
A
Multi-dimensional span for contiguous data सन्निहित डेटा के लिए बहुआयामी विस्तार
B
A 2D vector एक 2डी वेक्टर
C
A matrix class एक मैट्रिक्स वर्ग
D
A 3D array एक 3D सरणी
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) std::mdspan provides a multi-dimensional view over contiguous data without owning it.
व्याख्या (हिन्दी) std::mdspan बिना स्वामित्व के सन्निहित डेटा पर एक बहुआयामी दृश्य प्रदान करता है।
735
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
A
4 4
B
5 5
C
3 3
D
Compile error संकलन त्रुटि
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) First element not <4 is 4. Output: 4.
व्याख्या (हिन्दी) पहला तत्व नहीं
721–735 of 1915