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

Question 1606

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

Question 1607

EN + हिं
GB What is the output: vector v={1,2,3,4,5}; for(auto it=v.rbegin();it!=v.rend();++it) cout<<*it;
IN आउटपुट क्या है: वेक्टर v={1,2,3,4,5}; for(auto it=v.rbegin();it!=v.rend();++it) cout
54321 54321
12345 12345
Compile error संकलन त्रुटि
Undefined अपरिभाषित
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) Reversed. Output: 54321.
व्याख्या (हिन्दी) उलटा। आउटपुट: 54321.
🎯 Exam Perspective
यह सवाल OOP Using C++ category का है, और UPSC, SSC, Banking और Police भर्ती के exam pattern में इस तरह के questions common हैं। Answer choose करने के बाद दिया गया explanation जरूर पढ़ें।

Question 1608

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

Question 1609

EN + हिं
GB What is the output: int a[]={2,3,5,7,11,13}; cout<<*upper_bound(a,a+6,7);
IN आउटपुट क्या है: int a[]={2,3,5,7,11,13}; अदालत
11 11
7 7
Compile error संकलन त्रुटि
Undefined अपरिभाषित
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) First element > 7 is 11. Output: 11.
व्याख्या (हिन्दी) पहला तत्व > 7 11 है। आउटपुट: 11।
🎯 Exam Perspective
OOP Using C++ से जुड़ा यह सवाल उन students के लिए काम का है जो SSC, Railway, Banking और State PCS की तैयारी कर रहे हैं। बेहतर होगा कि explanation पढ़कर concept clear करें, ताकि exam में similar प्रश्न आने पर confusion न हो।

Question 1610

EN + हिं
GB What is the output: vector v={5,3,8,1,9}; auto m=max_element(v.begin(),v.end()); *m=0; cout<
IN आउटपुट क्या है: वेक्टर v={5,3,8,1,9}; ऑटो m=max_element(v.begin(),v.end()); *एम=0; अदालत
8 8
Compile error संकलन त्रुटि
Undefined अपरिभाषित
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) max is 9 at v[4]. *m=0 changes v[4]. v[2]=8. Output: 8.
व्याख्या (हिन्दी) v[4] पर अधिकतम 9 है। *m=0 परिवर्तन v[4]। वी[2]=8. आउटपुट: 8.
🎯 Exam Perspective
SSC CGL, IBPS, RRB और State-level परीक्षाओं जैसी परीक्षाओं में OOP Using C++ से सवाल अक्सर पूछे जाते हैं। इसलिए सिर्फ answer रटने के बजाय, नीचे दी गई explanation को ध्यान से पढ़ें और concept समझें।

Question 1611

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

Question 1612

EN + हिं
GB What is the output: string words[]={"","hello","","world",""}; int c=count_if(begin(words),end(words),[](const string&s){return !s.empty();});cout<
IN आउटपुट क्या है: स्ट्रिंग शब्द[]={"","हैलो","","दुनिया",""}; int c=count_if(begin(words),end(words),[](const string&s){return !s.empty();});cout
2 2
5 5
Compile error संकलन त्रुटि
Undefined अपरिभाषित
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) hello and world. count=2. Output: 2.
व्याख्या (हिन्दी) नमस्ते और दुनिया. गिनती=2. आउटपुट: 2.
🎯 Exam Perspective
OOP Using C++ के इस प्रश्न को कई प्रतियोगी परीक्षाओं जैसे Railway, SSC, Banking और Defence परीक्षाओं में repeat होते देखा गया है। Concept clarity के लिए explanation section जरूर पढ़ें।

Question 1613

EN + हिं
GB What is the output: int a[]={10,20,30,40,50}; transform(a,a+5,a,[](int x){return x/10;}); cout<
IN आउटपुट क्या है: int a[]={10,20,30,40,50}; परिवर्तन(ए,ए+5,ए,[](int x){रिटर्न x/10;}); अदालत
15 15
51 51
Compile error संकलन त्रुटि
Undefined अपरिभाषित
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) a={1,2,3,4,5}. a[0]=1,a[4]=5. Output: 15.
व्याख्या (हिन्दी) ए={1,2,3,4,5}। ए[0]=1,ए[4]=5. आउटपुट: 15.
🎯 Exam Perspective
यह सवाल OOP Using C++ category का है, और SSC, Railway, Banking और State PCS के exam pattern में इस तरह के questions common हैं। Answer choose करने के बाद दिया गया explanation जरूर पढ़ें।

Question 1614

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

Question 1615

EN + हिं
GB What is the output: int a[10]={0}; generate(a,a+10,[n=0]()mutable{return n+=2;}); cout<
IN आउटपुट क्या है: int a[10]={0}; generate(a,a+10,[n=0]()mutable{return n+=2;}); अदालत
10 10
8 8
Compile error संकलन त्रुटि
Undefined अपरिभाषित
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) 2,4,6,8,10,... a[4]=10. Output: 10.
व्याख्या (हिन्दी) 2,4,6,8,10,...ए[4]=10। आउटपुट: 10.
🎯 Exam Perspective
OOP Using C++ से जुड़ा यह सवाल उन students के लिए काम का है जो UPSC, SSC, Banking और Police भर्ती की तैयारी कर रहे हैं। बेहतर होगा कि explanation पढ़कर concept clear करें, ताकि exam में similar प्रश्न आने पर confusion न हो।

Question 1616

EN + हिं
GB What is the output: vector a={1,2,3},b={4,5,6},c; merge(a.begin(),a.end(),b.begin(),b.end(),back_inserter(c)); cout<
IN आउटपुट क्या है: वेक्टर a={1,2,3},b={4,5,6},c; मर्ज(a.begin(),a.end(),b.begin(),b.end(),back_inserter(c)); अदालत
4 4
3 3
Compile error संकलन त्रुटि
Undefined अपरिभाषित
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) Merged: 1,2,3,4,5,6. c[3]=4. Output: 4.
व्याख्या (हिन्दी) मर्ज: 1,2,3,4,5,6. सी[3]=4. आउटपुट: 4.
🎯 Exam Perspective
Railway, SSC, Banking और Defence परीक्षाओं जैसी परीक्षाओं में OOP Using C++ से सवाल अक्सर पूछे जाते हैं। इसलिए सिर्फ answer रटने के बजाय, नीचे दी गई explanation को ध्यान से पढ़ें और concept समझें।

Question 1617

EN + हिं
GB What is the output: int a[]={5,4,3,2,1}; int b[5]; partial_sort_copy(a,a+5,b,b+5); cout<
IN आउटपुट क्या है: int a[]={5,4,3,2,1}; पूर्णांक बी[5]; आंशिक_सॉर्ट_कॉपी(ए,ए+5,बी,बी+5); अदालत
15 15
51 51
Compile error संकलन त्रुटि
Undefined अपरिभाषित
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) Sorted copy: 1,2,3,4,5. b[0]=1,b[4]=5. Output: 15.
व्याख्या (हिन्दी) क्रमबद्ध प्रति: 1,2,3,4,5. बी[0]=1,बी[4]=5. आउटपुट: 15.
🎯 Exam Perspective
अगर आप SSC, Railway, Banking और State PCS की तैयारी कर रहे हैं, तो OOP Using C++ का यह topic आपके लिए महत्वपूर्ण है। Exam में accuracy बढ़ाने के लिए हर सवाल की explanation जरूर पढ़ें।

Question 1618

EN + हिं
GB What is the output: int a[]={1,2,3,4,5}; int* it=remove(a,a+5,3); cout<
IN आउटपुट क्या है: int a[]={1,2,3,4,5}; int* it=remove(a,a+5,3); अदालत
4 4
3 3
Compile error संकलन त्रुटि
Undefined अपरिभाषित
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) After remove: {1,2,4,5,_}. New end = a+4. Distance=4. Output: 4.
व्याख्या (हिन्दी) हटाने के बाद: {1,2,4,5,_}। नया अंत = ए+4. दूरी=4. आउटपुट: 4.
🎯 Exam Perspective
OOP Using C++ के इस प्रश्न को कई प्रतियोगी परीक्षाओं जैसे SSC CGL, IBPS, RRB और State-level परीक्षाओं में repeat होते देखा गया है। Concept clarity के लिए explanation section जरूर पढ़ें।

Question 1619

EN + हिं
GB What is the output: int a[5]; fill_n(a,5,3); cout<
IN आउटपुट क्या है: int a[5]; fill_n(ए,5,3); अदालत
45 45
15 15
Compile error संकलन त्रुटि
Undefined अपरिभाषित
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) 3^2*5=9*5=45. Output: 45.
व्याख्या (हिन्दी) 3^2*5=9*5=45. आउटपुट: 45.
🎯 Exam Perspective
यह सवाल OOP Using C++ category का है, और UPSC, SSC, Banking और Police भर्ती के exam pattern में इस तरह के questions common हैं। Answer choose करने के बाद दिया गया explanation जरूर पढ़ें।

Question 1620

EN + हिं
GB What is the output: vector> v={{3,"c"},{1,"a"},{2,"b"}}; sort(v.begin(),v.end()); cout<
IN आउटपुट क्या है: वेक्टर v={{3,"c"},{1,"a"},{2,"b"}}; क्रमबद्ध करें (v.begin(),v.end()); अदालत
ac ए.सी
ca सीए
Compile error संकलन त्रुटि
Undefined अपरिभाषित
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) Sorted: (1,a),(2,b),(3,c). v[0].second=a, v[2].second=c. Output: ac.
व्याख्या (हिन्दी) क्रमबद्ध: (1,ए),(2,बी),(3,सी)। v[0].सेकंड=ए, वी[2].सेकंड=सी. आउटपुट: एसी.
🎯 Exam Perspective
यह प्रश्न OOP Using C++ की तैयारी करने वाले अभ्यर्थियों के लिए उपयोगी है। इस तरह के प्रश्न अक्सर Railway, SSC, Banking और Defence परीक्षाओं जैसी परीक्षाओं में पूछे जाते रहे हैं, इसलिए concept और explanation दोनों को ध्यान से समझें, सिर्फ उत्तर याद न करें।