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
61
EN + हिं
GB What is the output: int a[3][3]={{1,2,3},{4,5,6},{7,8,9}}; cout<
IN आउटपुट क्या है: int a[3][3]={{1,2,3},{4,5,6},{7,8,9}}; अदालत
A
10 10
B
11 11
C
Compile error संकलन त्रुटि
D
Undefined अपरिभाषित
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) 3+7=10. Output: 10.
व्याख्या (हिन्दी) 3+7=10. आउटपुट: 10.
62
EN + हिं
GB What is the output: int a[]={10,20,30}; cout<<*max_element(a,a+3)-*min_element(a,a+3);
IN आउटपुट क्या है: int a[]={10,20,30}; अदालत
A
20 20
B
30 30
C
10 10
D
Compile error संकलन त्रुटि
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) 30-10=20. Output: 20.
व्याख्या (हिन्दी) 30-10=20. आउटपुट: 20.
63
EN + हिं
GB What is the output: int a[]={1,2,3,4,5}; cout<(),minus<>());
IN आउटपुट क्या है: int a[]={1,2,3,4,5}; अदालत
B
15 15
C
Compile error संकलन त्रुटि
D
Undefined अपरिभाषित
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) Each element minus itself=0; sum=0. Output: 0.
व्याख्या (हिन्दी) प्रत्येक तत्व शून्य से स्वयं=0; योग=0. आउटपुट: 0.
64
EN + हिं
GB What is the output: int a[]={5,3,8,1,4}; partial_sort(a,a+3,a+5); cout<
IN आउटपुट क्या है: int a[]={5,3,8,1,4}; आंशिक_सॉर्ट(ए,ए+3,ए+5); अदालत
A
138 138
B
345 345
C
Compile error संकलन त्रुटि
D
Undefined अपरिभाषित
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) 3 smallest in sorted order: 1,3,4. Output: 134.
व्याख्या (हिन्दी) क्रमबद्ध क्रम में 3 सबसे छोटे: 1,3,4. आउटपुट: 134.
65
EN + हिं
GB What is the output: vector v={1,2,3,4,5}; cout<());
IN आउटपुट क्या है: वेक्टर v={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.
66
EN + हिं
GB What is 'std::ranges::views::filter'?
IN 'std::ranges::views::filter' क्या है?
A
Lazy view filtering elements by predicate विधेय द्वारा तत्वों को फ़िल्टर करने का आलसी दृश्य
B
A sorted view एक क्रमबद्ध दृश्य
C
A transform view एक परिवर्तन दृश्य
D
An owning container एक मालिकाना कंटेनर
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) views::filter creates a lazy range that skips elements not satisfying the predicate.
व्याख्या (हिन्दी) दृश्य::फ़िल्टर एक आलसी श्रेणी बनाता है जो विधेय को संतुष्ट नहीं करने वाले तत्वों को छोड़ देता है।
67
EN + हिं
GB What is the output: int a[]={1,2,3,4,5}; cout<<*find_if(a,a+5,[](int x){return x*x>10;});
IN आउटपुट क्या है: int a[]={1,2,3,4,5}; अदालत
A
4 4
B
3 3
C
5 5
D
Compile error संकलन त्रुटि
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) 3^2=9<=10; 4^2=16>10. Output: 4.
व्याख्या (हिन्दी) 3^2=910. आउटपुट: 4.
68
EN + हिं
GB What is the output: string s="hello"; reverse(s.begin(),s.end()); cout<
IN आउटपुट क्या है: स्ट्रिंग s='हैलो'; रिवर्स(s.begin(),s.end()); अदालत
A
olleh ओलेह
B
hello नमस्ते
C
Compile error संकलन त्रुटि
D
Undefined अपरिभाषित
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) Output: olleh.
व्याख्या (हिन्दी) आउटपुट: ओलेह.
69
EN + हिं
GB What is the output: int a[]={1,2,3,4,5}; cout<
IN आउटपुट क्या है: int a[]={1,2,3,4,5}; अदालत
A
12345 12345
B
15 15
C
Compile error संकलन त्रुटि
D
Undefined अपरिभाषित
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) 0*10+1=1, 1*10+2=12, 12*10+3=123, ..., 12345. Output: 12345.
व्याख्या (हिन्दी) 0*10+1=1, 1*10+2=12, 12*10+3=123, ..., 12345। आउटपुट: 12345।
70
EN + हिं
GB What is the output: array a={4,3,2,1}; sort(a.begin(),a.end()); cout<
IN आउटपुट क्या है: array a={4,3,2,1}; सॉर्ट करें (a.begin(),a.end()); अदालत
A
14 14
B
41 41
C
Compile error संकलन त्रुटि
D
Undefined अपरिभाषित
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) Sorted: 1,2,3,4. front=1,back=4. Output: 14.
व्याख्या (हिन्दी) क्रमबद्ध: 1,2,3,4. आगे = 1, पीछे = 4. आउटपुट: 14.
71
EN + हिं
GB What is the output: int a[]={1,2,3,4,5}; auto sum=accumulate(begin(a),end(a),0); cout<
IN आउटपुट क्या है: int a[]={1,2,3,4,5}; स्वत: योग=संचय(शुरू(ए),अंत(ए),0); अदालत
A
15 15
B
5 5
C
Compile error संकलन त्रुटि
D
Undefined अपरिभाषित
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) Sum=15. Output: 15.
व्याख्या (हिन्दी) योग=15. आउटपुट: 15.
72
EN + हिं
GB What is the output: int a[]={3,1,4,1,5,9}; sort(begin(a),end(a)); cout<
IN आउटपुट क्या है: int a[]={3,1,4,1,5,9}; सॉर्ट करें (शुरू करें (ए), अंत (ए)); अदालत
A
49 49
B
Compile error संकलन त्रुटि
C
Undefined अपरिभाषित
D
19 19
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) Sorted: 1,1,3,4,5,9. a[2]=3,a[5]=9. Output: 39.
व्याख्या (हिन्दी) क्रमबद्ध: 1,1,3,4,5,9. ए[2]=3,ए[5]=9. आउटपुट: 39.
73
EN + हिं
GB What is the output: vector v={1,2,3,4,5}; auto it=v.begin()+2; v.insert(it,10); cout<
IN आउटपुट क्या है: वेक्टर v={1,2,3,4,5}; स्वतः यह=v.begin()+2; v.डालें(यह,10); अदालत
A
103 103
B
23 23
C
Compile error संकलन त्रुटि
D
Undefined अपरिभाषित
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) After insert: {1,2,10,3,4,5}. v[2]=10,v[3]=3. Output: 103.
व्याख्या (हिन्दी) डालने के बाद: {1,2,10,3,4,5}। v[2]=10,v[3]=3. आउटपुट: 103.
74
EN + हिं
GB What is the output: int a[]={1,2,3,4,5}; int s=0; for(auto p=a;p!=a+5;++p) s+=*p; cout<
IN आउटपुट क्या है: int a[]={1,2,3,4,5}; int s=0; for(auto p=a;p!=a+5;++p) s+=*p; अदालत
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.
75
EN + हिं
GB What is the output: vector v={5,3,8,1,9,2,7}; sort(v.begin(),v.end()); cout<
IN आउटपुट क्या है: वेक्टर v={5,3,8,1,9,2,7}; क्रमबद्ध करें (v.begin(),v.end()); अदालत
A
5 5
B
3 3
C
Compile error संकलन त्रुटि
D
Undefined अपरिभाषित
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) Sorted: 1,2,3,5,7,8,9. v[3]=5. Output: 5.
व्याख्या (हिन्दी) क्रमबद्ध: 1,2,3,5,7,8,9. वी[3]=5. आउटपुट: 5.
61–75 of 140