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 91

EN + हिं
GB What is the output: int a=10; cout<<(a>5)+(a<20)+(a==10);
IN आउटपुट क्या है: int a=10; अदालत
1 1
2 2
3 3
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) All three comparisons are true (=1 each): 1+1+1=3.
व्याख्या (हिन्दी) तीनों तुलनाएँ सत्य हैं (=1 प्रत्येक): 1+1+1=3।
🎯 Exam Perspective
OOP Using C++ से जुड़ा यह सवाल उन students के लिए काम का है जो UPSC, SSC, Banking और Police भर्ती की तैयारी कर रहे हैं। बेहतर होगा कि explanation पढ़कर concept clear करें, ताकि exam में similar प्रश्न आने पर confusion न हो।

Question 92

EN + हिं
GB Which operator is used for pointer-to-member access?
IN पॉइंटर-टू-मेंबर एक्सेस के लिए किस ऑपरेटर का उपयोग किया जाता है?
-> ->
.* .*
:: ::
& &
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) .* and ->* are pointer-to-member access operators in C++.
व्याख्या (हिन्दी) .* और ->* C++ में पॉइंटर-टू-मेंबर एक्सेस ऑपरेटर हैं।
🎯 Exam Perspective
Railway, SSC, Banking और Defence परीक्षाओं जैसी परीक्षाओं में OOP Using C++ से सवाल अक्सर पूछे जाते हैं। इसलिए सिर्फ answer रटने के बजाय, नीचे दी गई explanation को ध्यान से पढ़ें और concept समझें।

Question 93

EN + हिं
GB What is the result: int x = 5; x = x > 3 ? x + 1 : x - 1; cout << x;
IN परिणाम क्या है: int x = 5; एक्स = एक्स > 3 ? एक्स + 1 : एक्स - 1; अदालत
4 4
5 5
6 6
7 7
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) x>3 is true, so x = x+1 = 6.
व्याख्या (हिन्दी) x>3 सत्य है, इसलिए x = x+1 = 6.
🎯 Exam Perspective
अगर आप SSC, Railway, Banking और State PCS की तैयारी कर रहे हैं, तो OOP Using C++ का यह topic आपके लिए महत्वपूर्ण है। Exam में accuracy बढ़ाने के लिए हर सवाल की explanation जरूर पढ़ें।

Question 94

EN + हिं
GB What is the output: int a = 5, b = 10; cout << (a < b ? a : b) * 2;
IN आउटपुट क्या है: int a = 5, b = 10; अदालत
10 10
20 20
5 5
15 15
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) a
व्याख्या (हिन्दी)
🎯 Exam Perspective
OOP Using C++ के इस प्रश्न को कई प्रतियोगी परीक्षाओं जैसे SSC CGL, IBPS, RRB और State-level परीक्षाओं में repeat होते देखा गया है। Concept clarity के लिए explanation section जरूर पढ़ें।

Question 95

EN + हिं
GB What is the output: cout << 10/3*3;
IN आउटपुट क्या है: cout
10 10
9 9
3 3
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) Left to right: 10/3=3 (integer), 3*3=9.
व्याख्या (हिन्दी) बाएँ से दाएँ: 10/3=3 (पूर्णांक), 3*3=9।
🎯 Exam Perspective
यह सवाल OOP Using C++ category का है, और UPSC, SSC, Banking और Police भर्ती के exam pattern में इस तरह के questions common हैं। Answer choose करने के बाद दिया गया explanation जरूर पढ़ें।

Question 96

EN + हिं
GB What does overloading operator= return by convention?
IN ओवरलोडिंग ऑपरेटर = कन्वेंशन द्वारा क्या लौटाता है?
void खालीपन
bool बूल
*this (reference to self) *यह (स्वयं का संदर्भ)
const reference स्थिरांक संदर्भ
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) By convention, copy/move assignment operators return a reference to *this to enable chaining: a = b = c.
व्याख्या (हिन्दी) परंपरा के अनुसार, कॉपी/मूव असाइनमेंट ऑपरेटर चेनिंग को सक्षम करने के लिए *इस का संदर्भ लौटाते हैं: ए = बी = सी।
🎯 Exam Perspective
यह प्रश्न OOP Using C++ की तैयारी करने वाले अभ्यर्थियों के लिए उपयोगी है। इस तरह के प्रश्न अक्सर Railway, SSC, Banking और Defence परीक्षाओं जैसी परीक्षाओं में पूछे जाते रहे हैं, इसलिए concept और explanation दोनों को ध्यान से समझें, सिर्फ उत्तर याद न करें।

Question 97

EN + हिं
GB What is the output: int x = -5; cout << (x >> 1);
IN आउटपुट क्या है: int x = -5; कॉउट > 1);
-3 -3
-2 -2
-1 -1
Undefined अपरिभाषित
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) Right-shifting a negative signed integer is implementation-defined. On most platforms (arithmetic shift): -5>>1 = -3 (rounds toward negative infinity).
व्याख्या (हिन्दी) एक नकारात्मक हस्ताक्षरित पूर्णांक को राइट-शिफ्टिंग कार्यान्वयन-परिभाषित है। अधिकांश प्लेटफ़ॉर्म पर (अंकगणितीय बदलाव): -5>>1 = -3 (नकारात्मक अनंत की ओर राउंड)।
🎯 Exam Perspective
OOP Using C++ से जुड़ा यह सवाल उन students के लिए काम का है जो SSC, Railway, Banking और State PCS की तैयारी कर रहे हैं। बेहतर होगा कि explanation पढ़कर concept clear करें, ताकि exam में similar प्रश्न आने पर confusion न हो।

Question 98

EN + हिं
GB What is the output: int a=3,b=4; if(a=0) cout<
IN आउटपुट क्या है: int a=3,b=4; if(a=0) cout
3 3
4 4
Compile error संकलन त्रुटि
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) a=0 assigns 0 to a (evaluates to 0 = false), so else branch executes printing b=4.
व्याख्या (हिन्दी) a=0, a को 0 निर्दिष्ट करता है (0 = गलत का मूल्यांकन करता है), इसलिए अन्यथा शाखा b=4 मुद्रण निष्पादित करती है।
🎯 Exam Perspective
SSC CGL, IBPS, RRB और State-level परीक्षाओं जैसी परीक्षाओं में OOP Using C++ से सवाल अक्सर पूछे जाते हैं। इसलिए सिर्फ answer रटने के बजाय, नीचे दी गई explanation को ध्यान से पढ़ें और concept समझें।

Question 99

EN + हिं
GB What is the output: for(int i=0;i<5;i++) if(i==3) continue; cout<
IN आउटपुट क्या है: for(int i=0;i
01245 01245
01234 01234
Compile error संकलन त्रुटि
0124 0124
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) i is declared inside for; it's not accessible after the loop. Compile error.
व्याख्या (हिन्दी) i के लिए अंदर घोषित किया गया है; यह लूप के बाद पहुंच योग्य नहीं है। संकलन त्रुटि.
🎯 Exam Perspective
अगर आप UPSC, SSC, Banking और Police भर्ती की तैयारी कर रहे हैं, तो OOP Using C++ का यह topic आपके लिए महत्वपूर्ण है। Exam में accuracy बढ़ाने के लिए हर सवाल की explanation जरूर पढ़ें।

Question 100

EN + हिं
GB What is the output: int x=10; switch(x){case 10: cout<<'A'; case 20: cout<<'B'; default: cout<<'C';}
IN आउटपुट क्या है: int x=10; स्विच(x){केस 10: कॉउट
A
ABC एबीसी
AB अब
AC ए.सी
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) Without break statements, execution falls through all subsequent cases after matching case 10. Output: ABC.
व्याख्या (हिन्दी) ब्रेक स्टेटमेंट के बिना, केस 10 के मिलान के बाद सभी बाद के मामलों में निष्पादन गिर जाता है। आउटपुट: एबीसी।
🎯 Exam Perspective
OOP Using C++ के इस प्रश्न को कई प्रतियोगी परीक्षाओं जैसे Railway, SSC, Banking और Defence परीक्षाओं में repeat होते देखा गया है। Concept clarity के लिए explanation section जरूर पढ़ें।

Question 101

EN + हिं
GB What does 'goto' do in C++?
IN C++ में 'goto' क्या करता है?
Jumps to a labeled statement एक लेबल किए गए कथन पर चला जाता है
Is removed in C++11 C++11 में हटा दिया गया है
Only works inside loops केवल लूप के अंदर काम करता है
Causes undefined behavior अपरिभाषित व्यवहार का कारण बनता है
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) goto transfers control to a named label within the same function. It is legal but considered poor style.
व्याख्या (हिन्दी) goto transfers control to a named label within the same function. यह कानूनी है लेकिन ख़राब शैली मानी जाती है।
🎯 Exam Perspective
यह सवाल OOP Using C++ category का है, और SSC, Railway, Banking और State PCS के exam pattern में इस तरह के questions common हैं। Answer choose करने के बाद दिया गया explanation जरूर पढ़ें।

Question 102

EN + हिं
GB What is the output: int i=0; do{ cout<
IN आउटपुट क्या है: int i=0; करो {मुफ़्त करो
Nothing कुछ नहीं
01 01
Infinite loop अनंत लूप
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) do-while executes body at least once. Prints i=0, then i becomes 1, condition 1<0 is false, loop exits.
व्याख्या (हिन्दी) डू-व्हाइल बॉडी को कम से कम एक बार निष्पादित करता है। i=0 प्रिंट करता है, फिर i 1 हो जाता है, शर्त 1
🎯 Exam Perspective
यह प्रश्न OOP Using C++ की तैयारी करने वाले अभ्यर्थियों के लिए उपयोगी है। इस तरह के प्रश्न अक्सर SSC CGL, IBPS, RRB और State-level परीक्षाओं जैसी परीक्षाओं में पूछे जाते रहे हैं, इसलिए concept और explanation दोनों को ध्यान से समझें, सिर्फ उत्तर याद न करें।

Question 103

EN + हिं
GB What is the output: for(;;) { static int x=0; cout<2) break; }
IN आउटपुट क्या है: for(;;) {static int x=0; अदालत
012 012
123 123
Infinite loop अनंत लूप
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) Static x persists; loop: print 0, x=1; print 1, x=2; print 2, x=3, 3>2 break. Output: 012.
व्याख्या (हिन्दी) स्थैतिक x कायम रहता है; लूप: प्रिंट 0, x=1; प्रिंट 1, x=2; प्रिंट 2, x=3, 3>2 ​​ब्रेक। आउटपुट: 012.
🎯 Exam Perspective
OOP Using C++ से जुड़ा यह सवाल उन students के लिए काम का है जो UPSC, SSC, Banking और Police भर्ती की तैयारी कर रहे हैं। बेहतर होगा कि explanation पढ़कर concept clear करें, ताकि exam में similar प्रश्न आने पर confusion न हो।

Question 104

EN + हिं
GB What is the output: int x=5; if(x>3) if(x>4) cout<<'A'; else cout<<'B';
IN आउटपुट क्या है: int x=5; if(x>3) if(x>4) cout
A
B बी
AB अब
Nothing कुछ नहीं
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) Dangling else: else binds to nearest if. x>4 is true so 'A' is printed.
व्याख्या (हिन्दी) डैंगलिंग अन्य: अन्यथा निकटतम यदि से जुड़ता है। x>4 सत्य है इसलिए 'ए' मुद्रित है।
🎯 Exam Perspective
Railway, SSC, Banking और Defence परीक्षाओं जैसी परीक्षाओं में OOP Using C++ से सवाल अक्सर पूछे जाते हैं। इसलिए सिर्फ answer रटने के बजाय, नीचे दी गई explanation को ध्यान से पढ़ें और concept समझें।

Question 105

EN + हिं
GB What is the output: for(int i=0;i<3;i++) for(int j=0;j<3;j++) if(i==j) goto done; done: cout<<'X';
IN आउटपुट क्या है: for(int i=0;i
X एक्स
XXX XXX
Compile error संकलन त्रुटि
Undefined अपरिभाषित
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) When i==0 and j==0, goto jumps to done label, printing X once.
व्याख्या (हिन्दी) जब i==0 और j==0, गोटो पूर्ण लेबल पर चला जाता है, X को एक बार प्रिंट करता है।
🎯 Exam Perspective
अगर आप SSC, Railway, Banking और State PCS की तैयारी कर रहे हैं, तो OOP Using C++ का यह topic आपके लिए महत्वपूर्ण है। Exam में accuracy बढ़ाने के लिए हर सवाल की explanation जरूर पढ़ें।