31
OOP Using C++ — MCQ Practice
Hindi aur English dono mein practice karo — click karo answer check karne ke liye
32
B
Garbage
कचरा
C
Undefined
अपरिभाषित
D
Compile error
संकलन त्रुटि
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English)
Remaining elements zero-initialized. a[3]=0. Output: 0.
व्याख्या (हिन्दी)
शेष तत्व शून्य-प्रारंभिक हैं। ए[3]=0. आउटपुट: 0.
33
GB
What is the output: int a[]={1,2,3}; cout<
IN
आउटपुट क्या है: int a[]={1,2,3}; अदालत
A
12
12
B
3
3
C
8
8
D
Compile error
संकलन त्रुटि
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English)
3*4=12. Output: 12.
व्याख्या (हिन्दी)
3*4=12. आउटपुट: 12.
34
IN
आउटपुट क्या है: int a[3]; भरें(शुरू(ए),अंत(ए),7); अदालत
A
7
7
C
Compile error
संकलन त्रुटि
D
Undefined
अपरिभाषित
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English)
All elements 7. a[1]=7. Output: 7.
व्याख्या (हिन्दी)
सभी तत्व 7. a[1]=7. आउटपुट: 7.
35
IN
आउटपुट क्या है: int a[]={5,4,3,2,1}; स्थिर_सॉर्ट(ए,ए+5); अदालत
A
3
3
B
4
4
C
Compile error
संकलन त्रुटि
D
Undefined
अपरिभाषित
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English)
Sorted: 1,2,3,4,5. a[2]=3. Output: 3.
व्याख्या (हिन्दी)
क्रमबद्ध: 1,2,3,4,5. ए[2]=3. आउटपुट: 3.
36
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.
37
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.
38
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.
39
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.
40
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.
41
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.
42
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.
43
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.
44
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.
45
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।
31–45 of 140