OOP Using C++ — MCQ Practice

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

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

Question 46

EN + हिं
GB What is the output: cout<<(10>>1)<<(10<<1)<<(10%3);
IN आउटपुट क्या है: cout1)
5201 5201
520 520
Compile error संकलन त्रुटि
Undefined अपरिभाषित
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) 10>>1=5, 10<<1=20, 10%3=1. Output: 5201.
व्याख्या (हिन्दी) 10>>1=5, 10
🎯 Exam Perspective
OOP Using C++ ("Operators in C++" sub-topic) के इस प्रश्न को कई प्रतियोगी परीक्षाओं जैसे UPSC, SSC, Banking और Police भर्ती में repeat होते देखा गया है। Concept clarity के लिए explanation section जरूर पढ़ें।

Question 47

EN + हिं
GB What is the output: int x=5; cout<<~x;
IN आउटपुट क्या है: int x=5; अदालत
-6 -6
5 5
6 6
Compile error संकलन त्रुटि
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) ~5 flips all bits = -6 in two's complement. Output: -6.
व्याख्या (हिन्दी) ~5 सभी बिट्स को फ़्लिप करता है = -6 दो के पूरक में। आउटपुट: -6.
🎯 Exam Perspective
यह सवाल OOP Using C++ ("Operators in C++" sub-topic) category का है, और Railway, SSC, Banking और Defence परीक्षाओं के exam pattern में इस तरह के questions common हैं। Answer choose करने के बाद दिया गया explanation जरूर पढ़ें।

Question 48

EN + हिं
GB What is the output: int x=7,y=3; cout<<(x/y)<<(x%y)<<(x/y*y+x%y);
IN आउटपुट क्या है: int x=7,y=3; अदालत
221 221
217 217
Compile error संकलन त्रुटि
Undefined अपरिभाषित
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) 7/3=2, 7%3=1. 2*3+1=7. Output: 217.
व्याख्या (हिन्दी) 7/3=2, 7%3=1. 2*3+1=7. आउटपुट: 217.
🎯 Exam Perspective
यह प्रश्न OOP Using C++ ("Operators in C++" sub-topic) की तैयारी करने वाले अभ्यर्थियों के लिए उपयोगी है। इस तरह के प्रश्न अक्सर SSC, Railway, Banking और State PCS जैसी परीक्षाओं में पूछे जाते रहे हैं, इसलिए concept और explanation दोनों को ध्यान से समझें, सिर्फ उत्तर याद न करें।

Question 49

EN + हिं
GB What is the output: bool a=true,b=true; cout<<(a^b)<<(a==b)<<(a!=b);
IN आउटपुट क्या है: bool a=true,b=true; अदालत
010 010
011 011
110 110
Compile error संकलन त्रुटि
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) T^T=0, T==T=1, T!=T=0. Output: 010.
व्याख्या (हिन्दी) T^T=0, T==T=1, T!=T=0. आउटपुट: 010.
🎯 Exam Perspective
OOP Using C++ ("Operators in C++" sub-topic) से जुड़ा यह सवाल उन students के लिए काम का है जो SSC CGL, IBPS, RRB और State-level परीक्षाओं की तैयारी कर रहे हैं। बेहतर होगा कि explanation पढ़कर concept clear करें, ताकि exam में similar प्रश्न आने पर confusion न हो।

Question 50

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

Question 51

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

Question 52

EN + हिं
GB What is the output: int a=0b1010,b=0b1100; cout<<(a&b)<<(a|b)<<(a^b);
IN आउटपुट क्या है: int a=0b1010,b=0b1100; अदालत
8148 8148
Compile error संकलन त्रुटि
Undefined अपरिभाषित
8122 8122
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) 1010&1100=1000=8; 1010|1100=1110=14; 1010^1100=0110=6. Output: 8146.
व्याख्या (हिन्दी) 1010&1100=1000=8; 1010|1100=1110=14; 1010^1100=0110=6. आउटपुट: 8146.
🎯 Exam Perspective
OOP Using C++ ("Operators in C++" sub-topic) के इस प्रश्न को कई प्रतियोगी परीक्षाओं जैसे SSC, Railway, Banking और State PCS में repeat होते देखा गया है। Concept clarity के लिए explanation section जरूर पढ़ें।

Question 53

EN + हिं
GB What is the output: int x=256; cout<<(x>>8);
IN आउटपुट क्या है: int x=256; cout8);
1 1
256 256
Compile error संकलन त्रुटि
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) 256=1<<8. 256>>8=1. Output: 1.
व्याख्या (हिन्दी) 256=18=1. आउटपुट: 1.
🎯 Exam Perspective
यह सवाल OOP Using C++ ("Operators in C++" sub-topic) category का है, और SSC CGL, IBPS, RRB और State-level परीक्षाओं के exam pattern में इस तरह के questions common हैं। Answer choose करने के बाद दिया गया explanation जरूर पढ़ें।

Question 54

EN + हिं
GB What is 'operator new' overloading purpose?
IN 'ऑपरेटर नया' ओवरलोडिंग उद्देश्य क्या है?
Custom memory allocation (pool, arena, debug) कस्टम मेमोरी आवंटन (पूल, एरेना, डीबग)
Faster new तेज़ नया
Thread-safe allocation थ्रेड-सुरक्षित आवंटन
All of above उपरोक्त सभी
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) Overloading operator new allows custom allocators for performance, memory pools, or debugging.
व्याख्या (हिन्दी) ओवरलोडिंग ऑपरेटर नया प्रदर्शन, मेमोरी पूल या डिबगिंग के लिए कस्टम आवंटनकर्ताओं को अनुमति देता है।
🎯 Exam Perspective
यह प्रश्न OOP Using C++ ("Operators in C++" sub-topic) की तैयारी करने वाले अभ्यर्थियों के लिए उपयोगी है। इस तरह के प्रश्न अक्सर UPSC, SSC, Banking और Police भर्ती जैसी परीक्षाओं में पूछे जाते रहे हैं, इसलिए concept और explanation दोनों को ध्यान से समझें, सिर्फ उत्तर याद न करें।

Question 55

EN + हिं
GB What is the output: int x=5; cout<<(x+=1)+(x+=1);
IN आउटपुट क्या है: int x=5; अदालत
14 14
Undefined अपरिभाषित
Compile error संकलन त्रुटि
13 13
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) Pre-C++17 UB; C++17 still unspecified for +operands. UB.
व्याख्या (हिन्दी) प्री-सी++17 यूबी; C++17 अभी भी +ऑपरेंड के लिए निर्दिष्ट नहीं है। यूबी.
🎯 Exam Perspective
OOP Using C++ ("Operators in C++" sub-topic) से जुड़ा यह सवाल उन students के लिए काम का है जो Railway, SSC, Banking और Defence परीक्षाओं की तैयारी कर रहे हैं। बेहतर होगा कि explanation पढ़कर concept clear करें, ताकि exam में similar प्रश्न आने पर confusion न हो।

Question 56

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

Question 57

EN + हिं
GB What is the output: int x=15; cout<<(x&=~0x7);
IN आउटपुट क्या है: int x=15; अदालत
8 8
15 15
7 7
Compile error संकलन त्रुटि
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) ~0x7=...11111000. 15=00001111. AND=00001000=8. Output: 8.
व्याख्या (हिन्दी) ~0x7=...111111000. 15=00001111. तथा=00001000=8. आउटपुट: 8.
🎯 Exam Perspective
अगर आप SSC CGL, IBPS, RRB और State-level परीक्षाओं की तैयारी कर रहे हैं, तो OOP Using C++ ("Operators in C++" sub-topic) का यह topic आपके लिए महत्वपूर्ण है। Exam में accuracy बढ़ाने के लिए हर सवाल की explanation जरूर पढ़ें।

Question 58

EN + हिं
GB What is the output: int a=5,b=10; int c=(a>b)?a:b; cout<
IN आउटपुट क्या है: int a=5,b=10; int c=(a>b)?a:b; अदालत
10 10
5 5
Compile error संकलन त्रुटि
Undefined अपरिभाषित
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) a>b=false; returns b=10. Output: 10.
व्याख्या (हिन्दी) ए>बी=झूठा; रिटर्न b=10. आउटपुट: 10.
🎯 Exam Perspective
OOP Using C++ ("Operators in C++" sub-topic) के इस प्रश्न को कई प्रतियोगी परीक्षाओं जैसे UPSC, SSC, Banking और Police भर्ती में repeat होते देखा गया है। Concept clarity के लिए explanation section जरूर पढ़ें।

Question 59

EN + हिं
GB What is the output: int x=5; cout<<(x=x+1);
IN आउटपुट क्या है: int x=5; अदालत
6 6
5 5
Compile error संकलन त्रुटि
Undefined अपरिभाषित
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) x=x+1=6. Assignment returns 6. Output: 6.
व्याख्या (हिन्दी) x=x+1=6. असाइनमेंट रिटर्न 6. आउटपुट: 6.
🎯 Exam Perspective
यह सवाल OOP Using C++ ("Operators in C++" sub-topic) category का है, और Railway, SSC, Banking और Defence परीक्षाओं के exam pattern में इस तरह के questions common हैं। Answer choose करने के बाद दिया गया explanation जरूर पढ़ें।

Question 60

EN + हिं
GB What is the output: int x=5; if(x=0) cout<<'T'; else cout<<'F';
IN आउटपुट क्या है: int x=5; if(x=0) cout
F एफ
T टी
Compile error संकलन त्रुटि
Undefined अपरिभाषित
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) x=0 assigns 0; false; else: prints F. Output: F.
व्याख्या (हिन्दी) x=0 0 निर्दिष्ट करता है; असत्य; अन्यथा: एफ प्रिंट करता है। आउटपुट: एफ।
🎯 Exam Perspective
यह प्रश्न OOP Using C++ ("Operators in C++" sub-topic) की तैयारी करने वाले अभ्यर्थियों के लिए उपयोगी है। इस तरह के प्रश्न अक्सर SSC, Railway, Banking और State PCS जैसी परीक्षाओं में पूछे जाते रहे हैं, इसलिए concept और explanation दोनों को ध्यान से समझें, सिर्फ उत्तर याद न करें।