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 1636

EN + हिं
GB What is the output: vector v={1,2,3,4,5}; cout<{});
IN आउटपुट क्या है: वेक्टर v={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
OOP Using C++ के इस प्रश्न को कई प्रतियोगी परीक्षाओं जैसे Railway, SSC, Banking और Defence परीक्षाओं में repeat होते देखा गया है। Concept clarity के लिए explanation section जरूर पढ़ें।

Question 1637

EN + हिं
GB What is the output: int a[]={1,2,3,4,5}; int *p=a+2,*q=a; cout<
IN आउटपुट क्या है: int a[]={1,2,3,4,5}; int *p=a+2,*q=a; अदालत
21 21
23 23
Compile error संकलन त्रुटि
Undefined अपरिभाषित
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) p-q=2. *(q+p-a-2)=*(a+2+a-a-2)=*(a+... wait: q=a,p=a+2. p-a=2. *(q+2-2)=*(a)=1. q+p-a-2=a+a+2-a-2=a. *a=1. Hmm: 21. But *(q+p-a-2): q=a(pointer), p=a+2(pointer). q+p would be adding two pointers = UB. Output: Undefined.
व्याख्या (हिन्दी) पी-क्यू=2. *(q+p-a-2)=*(a+2+a-a-2)=*(a+... रुकें: q=a,p=a+2. p-a=2. *(q+2-2)=*(a)=1. q+p-a-2=a+a+2-a-2=a. *a=1. हम्म: 21. लेकिन *(q+p-a-2): q=a(सूचक), p=a+2(सूचक)। q+p दो सूचक जोड़ देगा = यूबी।
🎯 Exam Perspective
यह सवाल OOP Using C++ category का है, और SSC, Railway, Banking और State PCS के exam pattern में इस तरह के questions common हैं। Answer choose करने के बाद दिया गया explanation जरूर पढ़ें।

Question 1638

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

Question 1639

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

Question 1640

EN + हिं
GB What is the output: int x=5; int *p=&x; *p+=*p; cout<
IN आउटपुट क्या है: int x=5; int *p=&x; *पी+=*पी; अदालत
10 10
5 5
Compile error संकलन त्रुटि
Undefined अपरिभाषित
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) x+=x=10. Output: 10.
व्याख्या (हिन्दी) x+=x=10. आउटपुट: 10.
🎯 Exam Perspective
Railway, SSC, Banking और Defence परीक्षाओं जैसी परीक्षाओं में OOP Using C++ से सवाल अक्सर पूछे जाते हैं। इसलिए सिर्फ answer रटने के बजाय, नीचे दी गई explanation को ध्यान से पढ़ें और concept समझें।

Question 1641

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

Question 1642

EN + हिं
GB What is the output: char s[]="hello"; for(char *p=s;*p;p++) if(*p=='l') *p='L'; cout<
IN आउटपुट क्या है: char s[]='हैलो'; for(char *p=s;*p;p++) if(*p=='l') *p='L'; अदालत
heLLo नमस्ते
hello नमस्ते
Compile error संकलन त्रुटि
Undefined अपरिभाषित
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) Both l's replaced. Output: heLLo.
व्याख्या (हिन्दी) दोनों एल को बदल दिया गया। आउटपुट: हेलो.
🎯 Exam Perspective
OOP Using C++ के इस प्रश्न को कई प्रतियोगी परीक्षाओं जैसे SSC CGL, IBPS, RRB और State-level परीक्षाओं में repeat होते देखा गया है। Concept clarity के लिए explanation section जरूर पढ़ें।

Question 1643

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

Question 1644

EN + हिं
GB What is the output: int x=5; const int* cp=&x; int* const pc=&x; *pc=10; cout<<*cp;
IN आउटपुट क्या है: int x=5; स्थिरांक int* cp=&x; int* const pc=&x; *पीसी=10; अदालत
10 10
5 5
Compile error संकलन त्रुटि
Undefined अपरिभाषित
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) *pc=10 changes x=10. cp reads x=10. Output: 10.
व्याख्या (हिन्दी) *पीसी=10 परिवर्तन x=10। सीपी x=10 पढ़ता है। आउटपुट: 10.
🎯 Exam Perspective
यह प्रश्न OOP Using C++ की तैयारी करने वाले अभ्यर्थियों के लिए उपयोगी है। इस तरह के प्रश्न अक्सर Railway, SSC, Banking और Defence परीक्षाओं जैसी परीक्षाओं में पूछे जाते रहे हैं, इसलिए concept और explanation दोनों को ध्यान से समझें, सिर्फ उत्तर याद न करें।

Question 1645

EN + हिं
GB What is the output: auto p=make_unique>(3,4); cout<first+p->second;
IN आउटपुट क्या है: auto p=make_unique(3,4); कॉउटसेकंड;
7 7
12 12
Compile error संकलन त्रुटि
Undefined अपरिभाषित
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) 3+4=7. Output: 7.
व्याख्या (हिन्दी) 3+4=7. आउटपुट: 7.
🎯 Exam Perspective
OOP Using C++ से जुड़ा यह सवाल उन students के लिए काम का है जो SSC, Railway, Banking और State PCS की तैयारी कर रहे हैं। बेहतर होगा कि explanation पढ़कर concept clear करें, ताकि exam में similar प्रश्न आने पर confusion न हो।

Question 1646

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

Question 1647

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

Question 1648

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

Question 1649

EN + हिं
GB What is the output: string s="hello"; char *p=&s[0]; *(p+4)='!'; cout<
IN आउटपुट क्या है: स्ट्रिंग s='हैलो'; चार *p=&s[0]; *(पी+4)='!'; अदालत
hell! नरक!
hello नमस्ते
Compile error संकलन त्रुटि
Undefined अपरिभाषित
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) s[4]='!'. Output: hell!.
व्याख्या (हिन्दी) s[4]='!'. आउटपुट: नरक!
🎯 Exam Perspective
यह सवाल OOP Using C++ category का है, और SSC, Railway, Banking और State PCS के exam pattern में इस तरह के questions common हैं। Answer choose करने के बाद दिया गया explanation जरूर पढ़ें।

Question 1650

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