OOP Using C++ — MCQ Practice

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

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

Question 16

EN + हिं
GB What is the value of: int a = 010 + 0x10 + 10;
IN इसका मान क्या है: int a = 010 + 0x10 + 10;
30 30
34 34
42 42
36 36
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) 010 is octal 8, 0x10 is hex 16, 10 is decimal 10. Sum = 8+16+10 = 34. Wait: 8+16=24, 24+10=34. Answer is 34.
व्याख्या (हिन्दी) 010 अष्टक 8 है, 0x10 हेक्स 16 है, 10 दशमलव 10 है। योग = 8+16+10 = 34। प्रतीक्षा करें: 8+16=24, 24+10=34। उत्तर 34 है.
🎯 Exam Perspective
OOP Using C++ ("Introduction to C++" sub-topic) के इस प्रश्न को कई प्रतियोगी परीक्षाओं जैसे Railway, SSC, Banking और Defence परीक्षाओं में repeat होते देखा गया है। Concept clarity के लिए explanation section जरूर पढ़ें।

Question 17

EN + हिं
GB What is the maximum number of bytes a UTF-8 character can occupy?
IN एक UTF-8 कैरेक्टर अधिकतम कितनी बाइट्स ले सकता है?
2 2
3 3
4 4
6 6
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) The current Unicode standard uses up to 4 bytes in UTF-8 (code points up to U+10FFFF).
व्याख्या (हिन्दी) वर्तमान यूनिकोड मानक UTF-8 में 4 बाइट्स (U+10FFFF तक कोड बिंदु) का उपयोग करता है।
🎯 Exam Perspective
यह सवाल OOP Using C++ ("Introduction to C++" sub-topic) category का है, और SSC, Railway, Banking और State PCS के exam pattern में इस तरह के questions common हैं। Answer choose करने के बाद दिया गया explanation जरूर पढ़ें।

Question 18

EN + हिं
GB Which header must be included to use std::numeric_limits?
IN std::numeric_limits का उपयोग करने के लिए कौन सा हेडर शामिल किया जाना चाहिए?
<limits> <limits>
<climits> <climits>
<cfloat> <cfloat>
<numeric> <numeric>
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) std::numeric_limits is defined in the header in C++.
व्याख्या (हिन्दी) std::numeric_limits को C++ में हेडर में परिभाषित किया गया है।
🎯 Exam Perspective
यह प्रश्न OOP Using C++ ("Introduction to C++" sub-topic) की तैयारी करने वाले अभ्यर्थियों के लिए उपयोगी है। इस तरह के प्रश्न अक्सर SSC CGL, IBPS, RRB और State-level परीक्षाओं जैसी परीक्षाओं में पूछे जाते रहे हैं, इसलिए concept और explanation दोनों को ध्यान से समझें, सिर्फ उत्तर याद न करें।

Question 19

EN + हिं
GB What is the output: cout << (1 == 1 == 1);
IN आउटपुट क्या है: cout
1 1
true सत्य
Compile error संकलन त्रुटि
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) (1==1) evaluates to true (1), then (1==1) becomes true, so output is 1.
व्याख्या (हिन्दी) (1==1) सत्य (1) का मूल्यांकन करता है, फिर (1==1) सत्य हो जाता है, इसलिए आउटपुट 1 है।
🎯 Exam Perspective
OOP Using C++ ("Introduction to C++" sub-topic) से जुड़ा यह सवाल उन students के लिए काम का है जो UPSC, SSC, Banking और Police भर्ती की तैयारी कर रहे हैं। बेहतर होगा कि explanation पढ़कर concept clear करें, ताकि exam में similar प्रश्न आने पर confusion न हो।

Question 20

EN + हिं
GB In C++, which of the following has static storage duration?
IN C++ में, निम्न में से किसकी स्थिर भंडारण अवधि होती है?
Local variables inside functions फ़ंक्शंस के अंदर स्थानीय चर
Function parameters फ़ंक्शन पैरामीटर
Global variables सार्वत्रिक चर
Heap-allocated objects ढेर-आवंटित वस्तुएँ
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) Global variables (and static local variables, static data members) have static storage duration — they exist for the entire program lifetime.
व्याख्या (हिन्दी) वैश्विक चर (और स्थिर स्थानीय चर, स्थिर डेटा सदस्य) की स्थिर भंडारण अवधि होती है - वे पूरे कार्यक्रम जीवनकाल के लिए मौजूद रहते हैं।
🎯 Exam Perspective
Railway, SSC, Banking और Defence परीक्षाओं जैसी परीक्षाओं में OOP Using C++ ("Introduction to C++" sub-topic) से सवाल अक्सर पूछे जाते हैं। इसलिए सिर्फ answer रटने के बजाय, नीचे दी गई explanation को ध्यान से पढ़ें और concept समझें।

Question 21

EN + हिं
GB What is the output: int i=0; cout << i++ << i++;
IN आउटपुट क्या है: int i=0; अदालत
01 01
10 10
00 00
Undefined behavior अपरिभाषित व्यवहार
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) The order of evaluation of arguments to operator<< is unspecified before C++17, and modifying i twice is undefined behavior pre-C++17.
व्याख्या (हिन्दी) संचालक को तर्कों के मूल्यांकन का क्रम
🎯 Exam Perspective
अगर आप SSC, Railway, Banking और State PCS की तैयारी कर रहे हैं, तो OOP Using C++ ("Introduction to C++" sub-topic) का यह topic आपके लिए महत्वपूर्ण है। Exam में accuracy बढ़ाने के लिए हर सवाल की explanation जरूर पढ़ें।

Question 22

EN + हिं
GB What is the purpose of the 'volatile' keyword in C++?
IN C++ में 'अस्थिर' कीवर्ड का उद्देश्य क्या है?
Prevents compiler optimization on a variable एक वेरिएबल पर कंपाइलर ऑप्टिमाइज़ेशन को रोकता है
Makes a variable thread-safe एक वैरिएबल थ्रेड-सुरक्षित बनाता है
Stores a variable in registers रजिस्टरों में एक वेरिएबल संग्रहीत करता है
Makes a constant variable एक स्थिर चर बनाता है
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) volatile tells the compiler that the variable may be changed by external means (hardware, other thread), so every access must go to memory.
व्याख्या (हिन्दी) वोलेटाइल कंपाइलर को बताता है कि वेरिएबल को बाहरी माध्यमों (हार्डवेयर, अन्य थ्रेड) द्वारा बदला जा सकता है, इसलिए प्रत्येक एक्सेस को मेमोरी में जाना चाहिए।
🎯 Exam Perspective
OOP Using C++ ("Introduction to C++" sub-topic) के इस प्रश्न को कई प्रतियोगी परीक्षाओं जैसे SSC CGL, IBPS, RRB और State-level परीक्षाओं में repeat होते देखा गया है। Concept clarity के लिए explanation section जरूर पढ़ें।

Question 23

EN + हिं
GB What is 'RAII' in C++?
IN C++ में 'RAII' क्या है?
Random Access Initialization Index रैंडम एक्सेस इनिशियलाइज़ेशन इंडेक्स
Resource Acquisition Is Initialization संसाधन अधिग्रहण आरंभीकरण है
Recursive Algorithm Implementation Index पुनरावर्ती एल्गोरिथम कार्यान्वयन सूचकांक
Runtime Array Initialization Interface रनटाइम ऐरे इनिशियलाइज़ेशन इंटरफ़ेस
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) RAII ties resource management to object lifetime; resources are acquired in constructor and released in destructor.
व्याख्या (हिन्दी) आरएआईआई संसाधन प्रबंधन को वस्तु जीवनकाल से जोड़ता है; संसाधनों को कंस्ट्रक्टर में अर्जित किया जाता है और डिस्ट्रक्टर में जारी किया जाता है।
🎯 Exam Perspective
यह सवाल OOP Using C++ ("Introduction to C++" sub-topic) category का है, और UPSC, SSC, Banking और Police भर्ती के exam pattern में इस तरह के questions common हैं। Answer choose करने के बाद दिया गया explanation जरूर पढ़ें।

Question 24

EN + हिं
GB What is the output: int x=5,y=3; cout<<(x&y)<<' '<<(x|y)<<' '<<(x^y);
IN आउटपुट क्या है: int x=5,y=3; अदालत
1 7 6 1 7 6
5 3 6 5 3 6
1 5 6 1 5 6
3 7 5 3 7 5
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) 5=101, 3=011. AND=001=1, OR=111=7, XOR=110=6.
व्याख्या (हिन्दी) 5=101, 3=011. और=001=1, या=111=7, एक्सओआर=110=6।
🎯 Exam Perspective
यह प्रश्न OOP Using C++ ("Introduction to C++" sub-topic) की तैयारी करने वाले अभ्यर्थियों के लिए उपयोगी है। इस तरह के प्रश्न अक्सर Railway, SSC, Banking और Defence परीक्षाओं जैसी परीक्षाओं में पूछे जाते रहे हैं, इसलिए concept और explanation दोनों को ध्यान से समझें, सिर्फ उत्तर याद न करें।

Question 25

EN + हिं
GB Which is the correct way to prevent a class from being instantiated directly in C++?
IN किसी क्लास को सीधे C++ में इंस्टेंटियेट होने से रोकने का सही तरीका कौन सा है?
Declare constructor as private कंस्ट्रक्टर को निजी घोषित करें
Mark class as final कक्षा को अंतिम के रूप में चिह्नित करें
Declare at least one pure virtual function कम से कम एक शुद्ध वर्चुअल फ़ंक्शन घोषित करें
Use abstract keyword अमूर्त कीवर्ड का प्रयोग करें
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) Declaring at least one pure virtual function makes the class abstract and prevents direct instantiation.
व्याख्या (हिन्दी) कम से कम एक शुद्ध आभासी फ़ंक्शन की घोषणा करने से वर्ग अमूर्त हो जाता है और प्रत्यक्ष तात्कालिकता को रोकता है।
🎯 Exam Perspective
OOP Using C++ ("Introduction to C++" sub-topic) से जुड़ा यह सवाल उन students के लिए काम का है जो SSC, Railway, Banking और State PCS की तैयारी कर रहे हैं। बेहतर होगा कि explanation पढ़कर concept clear करें, ताकि exam में similar प्रश्न आने पर confusion न हो।

Question 26

EN + हिं
GB What is the output: cout << sizeof(void*) == sizeof(int*);
IN आउटपुट क्या है: cout
1 1
Compile error संकलन त्रुटि
Undefined अपरिभाषित
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) sizeof(void*) == sizeof(int*) is true (both are pointer types, same size). cout << true outputs 1.
व्याख्या (हिन्दी) sizeof(void*) == sizeof(int*) सत्य है (दोनों सूचक प्रकार हैं, समान आकार)। अदालत
🎯 Exam Perspective
SSC CGL, IBPS, RRB और State-level परीक्षाओं जैसी परीक्षाओं में OOP Using C++ ("Introduction to C++" sub-topic) से सवाल अक्सर पूछे जाते हैं। इसलिए सिर्फ answer रटने के बजाय, नीचे दी गई explanation को ध्यान से पढ़ें और concept समझें।

Question 27

EN + हिं
GB What does 'constexpr' guarantee?
IN 'constexpr' क्या गारंटी देता है?
Expression evaluated at compile time always अभिव्यक्ति का मूल्यांकन हमेशा संकलन समय पर किया जाता है
Expression CAN be evaluated at compile time संकलन समय पर अभिव्यक्ति का मूल्यांकन किया जा सकता है
Immutable variable अपरिवर्तनीय चर
Inlined function इनलाइन फ़ंक्शन
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) constexpr means the expression is potentially evaluated at compile time; if used in constant context it must be, otherwise it may run at runtime.
व्याख्या (हिन्दी) constexpr का अर्थ है कि संकलन समय पर अभिव्यक्ति का संभावित मूल्यांकन किया जाता है; यदि निरंतर संदर्भ में इसका उपयोग किया जाता है तो यह अवश्य होना चाहिए, अन्यथा यह रनटाइम पर चल सकता है।
🎯 Exam Perspective
अगर आप UPSC, SSC, Banking और Police भर्ती की तैयारी कर रहे हैं, तो OOP Using C++ ("Introduction to C++" sub-topic) का यह topic आपके लिए महत्वपूर्ण है। Exam में accuracy बढ़ाने के लिए हर सवाल की explanation जरूर पढ़ें।

Question 28

EN + हिं
GB What is the output: int arr[3]={1,2,3}; cout<
IN आउटपुट क्या है: int arr[3]={1,2,3}; अदालत
Compile error संकलन त्रुटि
Undefined behavior अपरिभाषित व्यवहार
Runtime exception क्रम अपवाद
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) Accessing arr[5] is out of bounds — undefined behavior. No bounds checking for raw arrays.
व्याख्या (हिन्दी) गिरफ्तारी[5] तक पहुंच सीमा से बाहर है - अपरिभाषित व्यवहार। कच्चे सरणियों की जाँच की कोई सीमा नहीं।
🎯 Exam Perspective
OOP Using C++ ("Introduction to C++" sub-topic) के इस प्रश्न को कई प्रतियोगी परीक्षाओं जैसे Railway, SSC, Banking और Defence परीक्षाओं में repeat होते देखा गया है। Concept clarity के लिए explanation section जरूर पढ़ें।

Question 29

EN + हिं
GB What is the meaning of 'ABI' in C++?
IN C++ में 'ABI' का क्या अर्थ है?
Abstract Binary Interface सार बाइनरी इंटरफ़ेस
Application Binary Interface एप्लिकेशन बाइनरी इंटरफ़ेस
Advanced Build Infrastructure उन्नत निर्माण अवसंरचना
Assembly Basic Instructions असेंबली के बुनियादी निर्देश
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) ABI defines how compiled code interacts at the binary level — calling conventions, name mangling, vtable layout, etc.
व्याख्या (हिन्दी) एबीआई परिभाषित करता है कि संकलित कोड बाइनरी स्तर पर कैसे इंटरैक्ट करता है - कॉलिंग कन्वेंशन, नेम मैंगलिंग, वीटेबल लेआउट इत्यादि।
🎯 Exam Perspective
यह सवाल OOP Using C++ ("Introduction to C++" sub-topic) category का है, और SSC, Railway, Banking और State PCS के exam pattern में इस तरह के questions common हैं। Answer choose करने के बाद दिया गया explanation जरूर पढ़ें।

Question 30

EN + हिं
GB Which operator cannot be overloaded in C++?
IN C++ में किस ऑपरेटर को ओवरलोड नहीं किया जा सकता है?
[] []
-> ->
:: ::
() ()
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) The scope resolution operator :: cannot be overloaded in C++.
व्याख्या (हिन्दी) स्कोप रिज़ॉल्यूशन ऑपरेटर :: को C++ में ओवरलोड नहीं किया जा सकता है।
🎯 Exam Perspective
यह प्रश्न OOP Using C++ ("Introduction to C++" sub-topic) की तैयारी करने वाले अभ्यर्थियों के लिए उपयोगी है। इस तरह के प्रश्न अक्सर SSC CGL, IBPS, RRB और State-level परीक्षाओं जैसी परीक्षाओं में पूछे जाते रहे हैं, इसलिए concept और explanation दोनों को ध्यान से समझें, सिर्फ उत्तर याद न करें।