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 31

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++ ("Operators in C++" sub-topic) से जुड़ा यह सवाल उन students के लिए काम का है जो SSC, Railway, Banking और State PCS की तैयारी कर रहे हैं। बेहतर होगा कि explanation पढ़कर concept clear करें, ताकि exam में similar प्रश्न आने पर confusion न हो।

Question 32

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++ ("Operators in C++" sub-topic) से सवाल अक्सर पूछे जाते हैं। इसलिए सिर्फ answer रटने के बजाय, नीचे दी गई explanation को ध्यान से पढ़ें और concept समझें।

Question 33

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

Question 34

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

Question 35

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

Question 36

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

Question 37

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

Question 38

EN + हिं
GB What is 'conditional assignment' idiom?
IN 'सशर्त असाइनमेंट' मुहावरा क्या है?
x = cond ? a : b; assign based on condition एक्स = शर्त? ए : बी; शर्त के आधार पर असाइन करें
Same as if-else यदि-अन्यथा के समान
Short-circuit assignment शॉर्ट-सर्किट असाइनमेंट
Macro pattern मैक्रो पैटर्न
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) Ternary for assignment: x=(n>0)?n:0 is concise conditional assignment.
व्याख्या (हिन्दी) असाइनमेंट के लिए टर्नरी: x=(n>0)?n:0 संक्षिप्त सशर्त असाइनमेंट है।
🎯 Exam Perspective
UPSC, SSC, Banking और Police भर्ती जैसी परीक्षाओं में OOP Using C++ ("Operators in C++" sub-topic) से सवाल अक्सर पूछे जाते हैं। इसलिए सिर्फ answer रटने के बजाय, नीचे दी गई explanation को ध्यान से पढ़ें और concept समझें।

Question 39

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

Question 40

EN + हिं
GB What is the output: int x=5; cout<<(x<<0);
IN आउटपुट क्या है: int x=5; अदालत
5 5
1 1
Compile error संकलन त्रुटि
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) Shift by 0 = no change. Output: 5.
व्याख्या (हिन्दी) 0 से शिफ्ट = कोई परिवर्तन नहीं। आउटपुट: 5.
🎯 Exam Perspective
OOP Using C++ ("Operators in C++" sub-topic) के इस प्रश्न को कई प्रतियोगी परीक्षाओं जैसे SSC, Railway, Banking और State PCS में repeat होते देखा गया है। Concept clarity के लिए explanation section जरूर पढ़ें।

Question 41

EN + हिं
GB What is the output: int x=5; cout<<(x>3&&x<10);
IN आउटपुट क्या है: int x=5; अदालत
1 1
Compile error संकलन त्रुटि
Undefined अपरिभाषित
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) 5>3=true, 5<10=true. true&&true=1. Output: 1.
व्याख्या (हिन्दी) 5>3=सत्य, 5
🎯 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 42

EN + हिं
GB What is 'safe bool idiom'?
IN 'सुरक्षित बूल मुहावरा' क्या है?
Explicit operator bool to prevent implicit numeric conversions अंतर्निहित संख्यात्मक रूपांतरणों को रोकने के लिए स्पष्ट ऑपरेटर बूल
A macro एक मैक्रो
A template एक टेम्पलेट
A design pattern एक डिज़ाइन पैटर्न
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) explicit operator bool() on smart pointers prevents accidental arithmetic like ptr+1.
व्याख्या (हिन्दी) स्मार्ट पॉइंटर्स पर स्पष्ट ऑपरेटर बूल() पीटीआर+1 जैसे आकस्मिक अंकगणित को रोकता है।
🎯 Exam Perspective
यह प्रश्न OOP Using C++ ("Operators in C++" sub-topic) की तैयारी करने वाले अभ्यर्थियों के लिए उपयोगी है। इस तरह के प्रश्न अक्सर UPSC, SSC, Banking और Police भर्ती जैसी परीक्षाओं में पूछे जाते रहे हैं, इसलिए concept और explanation दोनों को ध्यान से समझें, सिर्फ उत्तर याद न करें।

Question 43

EN + हिं
GB What is the output: int x=5; auto r=x>3?++x: (1, 6, 73, 3, 4, 'What is the output: int x=8; while(x&(x-1)) x&=x-1; cout<
IN आउटपुट क्या है: int x=5; ऑटो r=x>3?++x: (1, 6, 73, 3, 4, 'आउटपुट क्या है: int x=8; while(x&(x-1)) x&=x-1; cout
2026-05-25 2026-05-25
✅ Correct Answer:
🎯 Exam Perspective
OOP Using C++ ("Operators in C++" sub-topic) से जुड़ा यह सवाल उन students के लिए काम का है जो Railway, SSC, Banking और Defence परीक्षाओं की तैयारी कर रहे हैं। बेहतर होगा कि explanation पढ़कर concept clear करें, ताकि exam में similar प्रश्न आने पर confusion न हो।

Question 44

EN + हिं
GB What is the output: int x=8; while(x&(x-1)) x&=x-1; cout<
IN आउटपुट क्या है: int x=8; जबकि(x&(x-1)) x&=x-1; अदालत
8 8
4 4
1 1
Compile error संकलन त्रुटि
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) 8=1000 is already power of 2. 8&7=0: loop doesn't execute. Output: 8.
व्याख्या (हिन्दी) 8=1000 पहले से ही 2 की शक्ति है। 8&7=0: लूप निष्पादित नहीं होता है। आउटपुट: 8.
🎯 Exam Perspective
SSC, Railway, Banking और State PCS जैसी परीक्षाओं में OOP Using C++ ("Operators in C++" sub-topic) से सवाल अक्सर पूछे जाते हैं। इसलिए सिर्फ answer रटने के बजाय, नीचे दी गई explanation को ध्यान से पढ़ें और concept समझें।

Question 45

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