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
1291
EN + हिं
GB What is the output: int a[]={1,2,3,4,5}; cout<<*min_element(a,a+5)+*max_element(a,a+5);
IN आउटपुट क्या है: int a[]={1,2,3,4,5}; अदालत
A
6 6
B
5 5
C
Compile error संकलन त्रुटि
D
Undefined अपरिभाषित
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) 1+5=6. Output: 6.
व्याख्या (हिन्दी) 1+5=6. आउटपुट: 6.
1292
EN + हिं
GB What is the output: vector v={3,1,4,1,5,9,2,6}; sort(v.begin(),v.end()); v.erase(unique(v.begin(),v.end()),v.end()); cout<
IN आउटपुट क्या है: वेक्टर v={3,1,4,1,5,9,2,6}; क्रमबद्ध करें (v.begin(),v.end()); v.erase(unique(v.begin(),v.end()),v.end()); अदालत
A
7 7
B
6 6
C
Compile error संकलन त्रुटि
D
Undefined अपरिभाषित
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) Sorted: 1,1,2,3,4,5,6,9. Unique: 1,2,3,4,5,6,9=7. Output: 7.
व्याख्या (हिन्दी) क्रमबद्ध: 1,1,2,3,4,5,6,9। अद्वितीय: 1,2,3,4,5,6,9=7. आउटपुट: 7.
1293
EN + हिं
GB What is the output: int a[]={1,2,3,4,5}; cout<());
IN आउटपुट क्या है: int a[]={1,2,3,4,5}; अदालत
A
120 120
B
15 15
C
Compile error संकलन त्रुटि
D
Undefined अपरिभाषित
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) 1*1*2*3*4*5=120. Output: 120.
व्याख्या (हिन्दी) 1*1*2*3*4*5=120. आउटपुट: 120.
1294
EN + हिं
GB What is the output: int a[]={1,2,3}; int b[]={4,5,6}; cout<
IN आउटपुट क्या है: int a[]={1,2,3}; int b[]={4,5,6}; अदालत
A
32 32
B
15 15
C
Compile error संकलन त्रुटि
D
Undefined अपरिभाषित
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) 1*4+2*5+3*6=4+10+18=32. Output: 32.
व्याख्या (हिन्दी) 1*4+2*5+3*6=4+10+18=32. आउटपुट: 32.
1295
EN + हिं
GB What is the output: array a={5,4,3,2,1}; sort(a.begin(),a.end()); cout<
IN आउटपुट क्या है: array a={5,4,3,2,1}; सॉर्ट करें (a.begin(),a.end()); अदालत
A
15 15
B
51 51
C
Compile error संकलन त्रुटि
D
Undefined अपरिभाषित
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) Sorted: 1,2,3,4,5. a[0]=1,a[4]=5. Output: 15.
व्याख्या (हिन्दी) क्रमबद्ध: 1,2,3,4,5. ए[0]=1,ए[4]=5. आउटपुट: 15.
1296
EN + हिं
GB What is the output: int a[]={1,2,3,4,5}; cout<10;});
IN आउटपुट क्या है: int a[]={1,2,3,4,5}; अदालत
A
2 2
B
3 3
C
Compile error संकलन त्रुटि
D
Undefined अपरिभाषित
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) x=4: 16>10; x=5: 25>10. Count=2. But x=3: 9<=10. Output: 2.
व्याख्या (हिन्दी) x=4: 16>10; x=5: 25>10. गिनती=2. लेकिन x=3:9
1297
EN + हिं
GB What is the output: int a[]={2,4,6,8,10}; auto it=lower_bound(a,a+5,7); cout<<*it;
IN आउटपुट क्या है: int a[]={2,4,6,8,10}; ऑटो इट=लोअर_बाउंड(ए,ए+5,7); अदालत
A
8 8
B
6 6
C
Compile error संकलन त्रुटि
D
Undefined अपरिभाषित
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) First element >= 7 in {2,4,6,8,10} is 8. Output: 8.
व्याख्या (हिन्दी) {2,4,6,8,10} में पहला तत्व >=7 8 है। आउटपुट: 8।
1298
EN + हिं
GB What is the output: vector v={1,2,3,4,5}; v.resize(3); cout<
IN आउटपुट क्या है: वेक्टर v={1,2,3,4,5}; v.आकार बदलें(3); अदालत
A
33 33
B
53 53
C
Compile error संकलन त्रुटि
D
Undefined अपरिभाषित
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) After resize(3): {1,2,3}. size=3,back=3. Output: 33.
व्याख्या (हिन्दी) आकार बदलने के बाद(3): {1,2,3}। आकार = 3, पीछे = 3। आउटपुट: 33.
1299
EN + हिं
GB What is the output: int a[]={1,2,3,4,5}; partial_sort(a,a+3,a+5,greater()); cout<
IN आउटपुट क्या है: int a[]={1,2,3,4,5}; आंशिक_सॉर्ट(ए,ए+3,ए+5,अधिकतर()); अदालत
A
543 543
B
123 123
C
Compile error संकलन त्रुटि
D
Undefined अपरिभाषित
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) 3 largest in desc: 5,4,3. Output: 543.
व्याख्या (हिन्दी) विवरण में 3 सबसे बड़ा: 5,4,3। आउटपुट: 543.
1300
EN + हिं
GB What is the output: vector v(10); iota(v.begin(),v.end(),1); cout<
IN आउटपुट क्या है: वेक्टर v(10); iota(v.begin(),v.end(),1); अदालत
A
110 110
B
19 19
C
Compile error संकलन त्रुटि
D
Undefined अपरिभाषित
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) v={1..10}. v[0]=1,v[9]=10. Output: 110.
व्याख्या (हिन्दी) वी={1..10}. v[0]=1,v[9]=10. आउटपुट: 110.
1301
EN + हिं
GB What is the output: int a[]={1,2,3,4,5}; replace_if(a,a+5,[](int x){return x%2==0;},0); for(int x:a) cout<
IN आउटपुट क्या है: int a[]={1,2,3,4,5}; Replace_if(a,a+5,[](int x){return x%2==0;},0); for(int x:a) कोउट
A
10304 10304
B
12345 12345
C
Compile error संकलन त्रुटि
D
Undefined अपरिभाषित
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) a={1,0,3,0,5}. Output: 10305.
व्याख्या (हिन्दी) ए={1,0,3,0,5}. आउटपुट: 10305.
1302
EN + हिं
GB What is the output: int a[]={1,2,3,4,5}; int n=remove_if(a,a+5,[](int x){return x%2==0;})-a; cout<
IN आउटपुट क्या है: int a[]={1,2,3,4,5}; int n=remove_if(a,a+5,[](int x){return x%2==0;})-a; अदालत
A
3 3
B
2 2
C
Compile error संकलन त्रुटि
D
Undefined अपरिभाषित
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) Removes 2,4. Remaining: 1,3,5 = 3. Output: 3.
व्याख्या (हिन्दी) 2,4 को हटाता है। शेष: 1,3,5 = 3. आउटपुट: 3.
1303
EN + हिं
GB What is the output: int a[]={5,3,8,1,4}; make_heap(a,a+5); cout<
IN आउटपुट क्या है: int a[]={5,3,8,1,4}; मेक_हीप(ए,ए+5); अदालत
A
8 8
B
5 5
C
Compile error संकलन त्रुटि
D
Undefined अपरिभाषित
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) max-heap: a[0]=8. Output: 8.
व्याख्या (हिन्दी) अधिकतम-ढेर: a[0]=8. आउटपुट: 8.
1304
EN + हिं
GB What is the output: int a[]={1,2,3,4,5}; for_each_n(a,3,[](int& x){x*=2;}); cout<
IN आउटपुट क्या है: int a[]={1,2,3,4,5}; for_each_n(a,3,[](int& x){x*=2;}); अदालत
A
2 4 6 4 2 4 6 4
B
Compile error संकलन त्रुटि
C
Undefined अपरिभाषित
D
option_b विकल्प_बी
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) See explanation.
व्याख्या (हिन्दी) स्पष्टीकरण देखें.
1305
EN + हिं
GB What is the output: vector v={1,2,3}; auto w=v; reverse(w.begin(),w.end()); cout<<(v==w);
IN आउटपुट क्या है: वेक्टर v={1,2,3}; ऑटो w=v; रिवर्स(w.begin(),w.end()); अदालत
B
1 1
C
Compile error संकलन त्रुटि
D
Undefined अपरिभाषित
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) v={1,2,3} != {3,2,1}. Output: 0.
व्याख्या (हिन्दी) v={1,2,3} != {3,2,1}. आउटपुट: 0.
1291–1305 of 1915