OOP Using C++ — MCQ Practice

Hindi aur English dono mein practice karo — click karo answer check karne ke liye.

📚 127 Questions 🌐 Hindi + English ✅ Free
भाषा / Language:
127 questions

Question 121

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

Question 122

EN + हिं
GB What is the output: int x=42; auto wp=weak_ptr{}; {auto sp=make_shared(x); wp=sp; cout<<*wp.lock()<<' ';} cout<
IN आउटपुट क्या है: int x=42; ऑटो wp=weak_ptr{}; {ऑटो एसपी=मेक_शेयर्ड(x); wp=sp; अदालत
42 1 42 1
42 0 42 0
Compile error संकलन त्रुटि
Undefined अपरिभाषित
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) Inside block: lock=42. After block: expired=1. Output: 42 1.
व्याख्या (हिन्दी) अंदर का ब्लॉक: लॉक=42. ब्लॉक के बाद: समाप्त=1. आउटपुट: 42 1.
🎯 Exam Perspective
Railway, SSC, Banking और Defence परीक्षाओं जैसी परीक्षाओं में OOP Using C++ ("Pointers" sub-topic) से सवाल अक्सर पूछे जाते हैं। इसलिए सिर्फ answer रटने के बजाय, नीचे दी गई explanation को ध्यान से पढ़ें और concept समझें।

Question 123

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

Question 124

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

Question 125

EN + हिं
GB What is the output: int x=0; auto p=&x; for(int i=0;i<5;++i) ++*p; cout<
IN आउटपुट क्या है: int x=0; ऑटो पी=&x; for(int i=0;i
5 5
1 1
Compile error संकलन त्रुटि
Undefined अपरिभाषित
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) *p is x; incremented 5 times. Output: 5.
व्याख्या (हिन्दी) *पी एक्स है; 5 गुना वृद्धि. आउटपुट: 5.
🎯 Exam Perspective
यह सवाल OOP Using C++ ("Pointers" sub-topic) category का है, और UPSC, SSC, Banking और Police भर्ती के exam pattern में इस तरह के questions common हैं। Answer choose करने के बाद दिया गया explanation जरूर पढ़ें।

Question 126

EN + हिं
GB What is the output: struct P{int x,y;}; P a{3,4}; P *p=&a; cout<x*p->x+p->y*p->y;
IN आउटपुट क्या है: struct P{int x,y;}; पी ए{3,4}; पी *पी=&ए; coutx+p->y*p->y;
25 25
7 7
Compile error संकलन त्रुटि
Undefined अपरिभाषित
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) 9+16=25. Output: 25.
व्याख्या (हिन्दी) 9+16=25. आउटपुट: 25.
🎯 Exam Perspective
यह प्रश्न OOP Using C++ ("Pointers" sub-topic) की तैयारी करने वाले अभ्यर्थियों के लिए उपयोगी है। इस तरह के प्रश्न अक्सर Railway, SSC, Banking और Defence परीक्षाओं जैसी परीक्षाओं में पूछे जाते रहे हैं, इसलिए concept और explanation दोनों को ध्यान से समझें, सिर्फ उत्तर याद न करें।

Question 127

EN + हिं
GB What is the output: int a[]={2,4,6,8,10}; for(auto *p=rbegin(a);p!=rend(a);++p) cout<<*p;
IN आउटपुट क्या है: int a[]={2,4,6,8,10}; for(auto *p=rbegin(a);p!=rend(a);++p) cout
10 8 6 4 2 10 8 6 4 2
108642 108642
Compile error संकलन त्रुटि
Undefined अपरिभाषित
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) Outputs 10,8,6,4,2. Output: 108642.
व्याख्या (हिन्दी) आउटपुट 10,8,6,4,2. आउटपुट: 108642.
🎯 Exam Perspective
OOP Using C++ ("Pointers" sub-topic) से जुड़ा यह सवाल उन students के लिए काम का है जो SSC, Railway, Banking और State PCS की तैयारी कर रहे हैं। बेहतर होगा कि explanation पढ़कर concept clear करें, ताकि exam में similar प्रश्न आने पर confusion न हो।