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

Question 1

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

Question 2

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

Question 3

EN + हिं
GB What is the size of: int arr[10]; cout<
IN What is the size of: int arr[10]; अदालत
10 10
40 40
8 8
Compile error संकलन त्रुटि
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) sizeof(arr)=10*sizeof(int)=10*4=40 on most platforms.
व्याख्या (हिन्दी) अधिकांश प्लेटफ़ॉर्म पर sizeof(arr)=10*sizeof(int)=10*4=40।
🎯 Exam Perspective
अगर आप UPSC, SSC, Banking और Police भर्ती की तैयारी कर रहे हैं, तो OOP Using C++ ("Arrays" sub-topic) का यह topic आपके लिए महत्वपूर्ण है। Exam में accuracy बढ़ाने के लिए हर सवाल की explanation जरूर पढ़ें।

Question 4

EN + हिं
GB What is the output: int a[5]={1}; cout<
IN What is the output: int a[5]={1}; अदालत
1 1
Undefined अपरिभाषित
Garbage कचरा
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) Partial initialization zero-fills remaining elements: a[4]=0.
व्याख्या (हिन्दी) आंशिक आरंभीकरण शून्य-शेष तत्वों को भरता है: a[4]=0।
🎯 Exam Perspective
OOP Using C++ ("Arrays" sub-topic) के इस प्रश्न को कई प्रतियोगी परीक्षाओं जैसे Railway, SSC, Banking और Defence परीक्षाओं में repeat होते देखा गया है। Concept clarity के लिए explanation section जरूर पढ़ें।

Question 5

EN + हिं
GB What is the output: int a[]={1,2,3}; cout<
IN आउटपुट क्या है: int a[]={1,2,3}; अदालत
1 1
3 3
4 4
12 12
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) sizeof(a)=12, sizeof(a[0])=4. 12/4=3 (array length).
व्याख्या (हिन्दी) आकार(ए)=12, आकार(ए[0])=4. 12/4=3 (सरणी लंबाई)।
🎯 Exam Perspective
यह सवाल OOP Using C++ ("Arrays" sub-topic) category का है, और SSC, Railway, Banking और State PCS के exam pattern में इस तरह के questions common हैं। Answer choose करने के बाद दिया गया explanation जरूर पढ़ें।

Question 6

EN + हिं
GB What is the output: char s[]="hello"; cout<
IN What is the output: char s[]="hello"; अदालत
5 5
6 6
8 8
Undefined अपरिभाषित
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) sizeof(s) includes null terminator: 6 bytes.
व्याख्या (हिन्दी) sizeof(s) में शून्य टर्मिनेटर शामिल है: 6 बाइट्स।
🎯 Exam Perspective
यह प्रश्न OOP Using C++ ("Arrays" sub-topic) की तैयारी करने वाले अभ्यर्थियों के लिए उपयोगी है। इस तरह के प्रश्न अक्सर SSC CGL, IBPS, RRB और State-level परीक्षाओं जैसी परीक्षाओं में पूछे जाते रहे हैं, इसलिए concept और explanation दोनों को ध्यान से समझें, सिर्फ उत्तर याद न करें।

Question 7

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

Question 8

EN + हिं
GB What is the output: int a[]={5,4,3,2,1}; sort(a,a+5); cout<
IN What is the output: int a[]={5,4,3,2,1}; sort(a,a+5); अदालत
1 1
5 5
3 3
Compile error संकलन त्रुटि
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) std::sort sorts ascending; a[0]=1.
व्याख्या (हिन्दी) std::सॉर्ट आरोही प्रकार; ए[0]=1.
🎯 Exam Perspective
Railway, SSC, Banking और Defence परीक्षाओं जैसी परीक्षाओं में OOP Using C++ ("Arrays" sub-topic) से सवाल अक्सर पूछे जाते हैं। इसलिए सिर्फ answer रटने के बजाय, नीचे दी गई explanation को ध्यान से पढ़ें और concept समझें।

Question 9

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

Question 10

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

Question 11

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

Question 12

EN + हिं
GB What is the output: int a[5]; cout<
IN What is the output: int a[5]; अदालत
Undefined behavior अपरिभाषित व्यवहार
Garbage value कचरा मूल्य
Compile error संकलन त्रुटि
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) Uninitialized local array elements have indeterminate values; reading them is undefined behavior.
व्याख्या (हिन्दी) अप्रारंभीकृत स्थानीय सरणी तत्वों में अनिश्चित मान होते हैं; उन्हें पढ़ना अपरिभाषित व्यवहार है।
🎯 Exam Perspective
यह प्रश्न OOP Using C++ ("Arrays" sub-topic) की तैयारी करने वाले अभ्यर्थियों के लिए उपयोगी है। इस तरह के प्रश्न अक्सर Railway, SSC, Banking और Defence परीक्षाओं जैसी परीक्षाओं में पूछे जाते रहे हैं, इसलिए concept और explanation दोनों को ध्यान से समझें, सिर्फ उत्तर याद न करें।

Question 13

EN + हिं
GB What is VLA (Variable Length Array) in C++?
IN C++ में VLA (वैरिएबल लेंथ ऐरे) क्या है?
Supported since C++11 C++11 से समर्थित
Not part of C++ standard (only C99) C++ मानक का हिस्सा नहीं (केवल C99)
Supported with dynamic memory गतिशील मेमोरी के साथ समर्थित
Same as std::vector एसटीडी::वेक्टर के समान
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) VLAs are part of C99 but NOT in the C++ standard; some compilers support them as extensions.
व्याख्या (हिन्दी) वीएलए सी99 का हिस्सा हैं लेकिन सी++ मानक में नहीं; कुछ कंपाइलर एक्सटेंशन के रूप में उनका समर्थन करते हैं।
🎯 Exam Perspective
OOP Using C++ ("Arrays" sub-topic) से जुड़ा यह सवाल उन students के लिए काम का है जो SSC, Railway, Banking और State PCS की तैयारी कर रहे हैं। बेहतर होगा कि explanation पढ़कर concept clear करें, ताकि exam में similar प्रश्न आने पर confusion न हो।

Question 14

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

Question 15

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