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 31

EN + हिं
GB What is the output: int x = -1; unsigned int y = x; cout << (y > 0);
IN आउटपुट क्या है: int x = -1; अहस्ताक्षरित int y = x; कोउट 0);
1 1
Undefined अपरिभाषित
Compile error संकलन त्रुटि
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) -1 converted to unsigned int becomes UINT_MAX (a large positive number), so y > 0 is true, output is 1.
व्याख्या (हिन्दी) -1 को अहस्ताक्षरित int में परिवर्तित करने पर UINT_MAX (एक बड़ी धनात्मक संख्या) बन जाती है, इसलिए y > 0 सत्य है, आउटपुट 1 है।
🎯 Exam Perspective
OOP Using C++ से जुड़ा यह सवाल उन students के लिए काम का है जो UPSC, SSC, Banking और Police भर्ती की तैयारी कर रहे हैं। बेहतर होगा कि explanation पढ़कर concept clear करें, ताकि exam में similar प्रश्न आने पर confusion न हो।

Question 32

EN + हिं
GB What is a 'sequence point' in C++?
IN C++ में 'अनुक्रम बिंदु' क्या है?
A point where all side effects are complete एक ऐसा बिंदु जहां सभी दुष्प्रभाव पूर्ण हो जाते हैं
A semicolon in code कोड में एक अर्धविराम
A function call boundary एक फ़ंक्शन कॉल सीमा
A memory barrier एक स्मृति बाधा
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) A sequence point ensures all side effects of previous evaluations are complete before the next expression begins evaluation.
व्याख्या (हिन्दी) एक अनुक्रम बिंदु यह सुनिश्चित करता है कि अगली अभिव्यक्ति का मूल्यांकन शुरू होने से पहले पिछले मूल्यांकन के सभी दुष्प्रभाव पूरे हो जाएं।
🎯 Exam Perspective
Railway, SSC, Banking और Defence परीक्षाओं जैसी परीक्षाओं में OOP Using C++ से सवाल अक्सर पूछे जाते हैं। इसलिए सिर्फ answer रटने के बजाय, नीचे दी गई explanation को ध्यान से पढ़ें और concept समझें।

Question 33

EN + हिं
GB In C++, what does 'decltype(auto)' do?
IN C++ में, 'decltype(auto)' क्या करता है?
Deduces type like auto ऑटो जैसे प्रकार का अनुमान लगाता है
Deduces exact type including references संदर्भ सहित सटीक प्रकार का पता लगाता है
Only works with templates केवल टेम्प्लेट के साथ काम करता है
Equivalent to decltype डिक्ल्टाइप के समतुल्य
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) decltype(auto) deduces the type using decltype rules, preserving reference and cv-qualifiers, unlike plain auto which strips them.
व्याख्या (हिन्दी) decltype(auto) संदर्भ और cv-क्वालिफायर को संरक्षित करते हुए, decltype नियमों का उपयोग करके प्रकार का अनुमान लगाता है, सादे ऑटो के विपरीत जो उन्हें हटा देता है।
🎯 Exam Perspective
अगर आप SSC, Railway, Banking और State PCS की तैयारी कर रहे हैं, तो OOP Using C++ का यह topic आपके लिए महत्वपूर्ण है। Exam में accuracy बढ़ाने के लिए हर सवाल की explanation जरूर पढ़ें।

Question 34

EN + हिं
GB What is the maximum value of a signed 32-bit integer?
IN हस्ताक्षरित 32-बिट पूर्णांक का अधिकतम मान क्या है?
2^32 - 1 2^32 - 1
2^31 2^31
2^31 - 1 2^31 - 1
2^32 2^32
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) A signed 32-bit int stores values from -2^31 to 2^31-1, i.e., -2147483648 to 2147483647.
व्याख्या (हिन्दी) एक हस्ताक्षरित 32-बिट इंट -2^31 से 2^31-1 तक मान संग्रहीत करता है, अर्थात, -2147483648 से 2147483647 तक।
🎯 Exam Perspective
OOP Using C++ के इस प्रश्न को कई प्रतियोगी परीक्षाओं जैसे SSC CGL, IBPS, RRB और State-level परीक्षाओं में repeat होते देखा गया है। Concept clarity के लिए explanation section जरूर पढ़ें।

Question 35

EN + हिं
GB What is the output: int x=INT_MIN; cout << -x;
IN आउटपुट क्या है: int x=INT_MIN; अदालत
INT_MAX INT_MAX
INT_MIN INT_MIN
Undefined behavior अपरिभाषित व्यवहार
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) Negating INT_MIN causes signed integer overflow, which is undefined behavior in C++.
व्याख्या (हिन्दी) INT_MIN को नकारने से हस्ताक्षरित पूर्णांक अतिप्रवाह होता है, जो C++ में अपरिभाषित व्यवहार है।
🎯 Exam Perspective
यह सवाल OOP Using C++ category का है, और UPSC, SSC, Banking और Police भर्ती के exam pattern में इस तरह के questions common हैं। Answer choose करने के बाद दिया गया explanation जरूर पढ़ें।

Question 36

EN + हिं
GB Which type can hold a pointer to any object type?
IN कौन सा प्रकार किसी ऑब्जेक्ट प्रकार पर पॉइंटर रख सकता है?
void* खालीपन*
char* चार*
int* int*
nullptr_t nullptr_t
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) void* is a generic pointer type that can hold a pointer to any object type, though it cannot be dereferenced directly.
व्याख्या (हिन्दी) void* एक सामान्य सूचक प्रकार है जो किसी भी ऑब्जेक्ट प्रकार के लिए सूचक को पकड़ सकता है, हालांकि इसे सीधे संदर्भित नहीं किया जा सकता है।
🎯 Exam Perspective
यह प्रश्न OOP Using C++ की तैयारी करने वाले अभ्यर्थियों के लिए उपयोगी है। इस तरह के प्रश्न अक्सर Railway, SSC, Banking और Defence परीक्षाओं जैसी परीक्षाओं में पूछे जाते रहे हैं, इसलिए concept और explanation दोनों को ध्यान से समझें, सिर्फ उत्तर याद न करें।

Question 37

EN + हिं
GB What is the value of: auto x = 3.14f; decltype(x) y = 2; cout << sizeof(y);
IN इसका मान क्या है: ऑटो x = 3.14f; decltype(x) y = 2; अदालत
4 4
8 8
2 2
Depends on platform प्लेटफार्म पर निर्भर करता है
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) 3.14f is float, so x is float. decltype(x) is float. sizeof(float) = 4.
व्याख्या (हिन्दी) 3.14f फ्लोट है, इसलिए x फ्लोट है। decltype(x) फ्लोट है। आकार(फ्लोट) = 4.
🎯 Exam Perspective
OOP Using C++ से जुड़ा यह सवाल उन students के लिए काम का है जो SSC, Railway, Banking और State PCS की तैयारी कर रहे हैं। बेहतर होगा कि explanation पढ़कर concept clear करें, ताकि exam में similar प्रश्न आने पर confusion न हो।

Question 38

EN + हिं
GB What is the difference between int and long in C++?
IN C++ में int और long के बीच क्या अंतर है?
long is always 64-bit long हमेशा 64-बिट होता है
int is always 32-bit int हमेशा 32-बिट होता है
sizeof(long) >= sizeof(int) is guaranteed sizeof(long) >= sizeof(int) की गारंटी है
They are identical वे समान हैं
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) The standard only guarantees sizeof(short)<=sizeof(int)<=sizeof(long)<=sizeof(long long). Exact sizes are implementation-defined.
व्याख्या (हिन्दी) मानक केवल आकार(छोटा) की गारंटी देता है
🎯 Exam Perspective
SSC CGL, IBPS, RRB और State-level परीक्षाओं जैसी परीक्षाओं में OOP Using C++ से सवाल अक्सर पूछे जाते हैं। इसलिए सिर्फ answer रटने के बजाय, नीचे दी गई explanation को ध्यान से पढ़ें और concept समझें।

Question 39

EN + हिं
GB What happens: const int x = 5; int* p = const_cast(&x); *p = 10; cout << x;
IN क्या होता है: const int x = 5; int* p = const_cast(&x); *पी = 10; अदालत
10 10
5 5
Undefined behavior अपरिभाषित व्यवहार
Compile error संकलन त्रुटि
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) Modifying a const object through const_cast is undefined behavior; the compiler may cache the value of x as 5.
व्याख्या (हिन्दी) const_cast के माध्यम से किसी const ऑब्जेक्ट को संशोधित करना अपरिभाषित व्यवहार है; कंपाइलर x का मान 5 के रूप में कैश कर सकता है।
🎯 Exam Perspective
अगर आप UPSC, SSC, Banking और Police भर्ती की तैयारी कर रहे हैं, तो OOP Using C++ का यह topic आपके लिए महत्वपूर्ण है। Exam में accuracy बढ़ाने के लिए हर सवाल की explanation जरूर पढ़ें।

Question 40

EN + हिं
GB What is the output: int x = 0b1010; cout << x;
IN आउटपुट क्या है: int x = 0b1010; अदालत
1010 1010
10 10
8 8
Compile error (pre C++14) संकलन त्रुटि (पूर्व C++14)
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) Binary literals (0b prefix) are supported in C++14+. 0b1010 = 10 in decimal.
व्याख्या (हिन्दी) C++14+ में बाइनरी अक्षर (0b उपसर्ग) समर्थित हैं। 0b1010 = 10 दशमलव में.
🎯 Exam Perspective
OOP Using C++ के इस प्रश्न को कई प्रतियोगी परीक्षाओं जैसे Railway, SSC, Banking और Defence परीक्षाओं में repeat होते देखा गया है। Concept clarity के लिए explanation section जरूर पढ़ें।

Question 41

EN + हिं
GB Which of these correctly initializes all elements to zero?
IN इनमें से कौन सभी तत्वों को शून्य पर सही ढंग से प्रारंभ करता है?
int arr[5]; int गिरफ्तारी[5];
int arr[5] = {}; पूर्णांक गिरफ्तारी[5] = {};
int arr[5] = {0}; पूर्णांक गिरफ्तारी[5] = {0};
Both B and C बी और सी दोनों
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) int arr[5]={} and int arr[5]={0} both value-initialize all elements to 0. Plain int arr[5] leaves them uninitialized at block scope.
व्याख्या (हिन्दी) int arr[5]={} और int arr[5]={0} दोनों सभी तत्वों को 0 पर मान-प्रारंभ करते हैं। सादा int arr[5] उन्हें ब्लॉक स्कोप पर अप्रारंभीकृत छोड़ देता है।
🎯 Exam Perspective
यह सवाल OOP Using C++ category का है, और SSC, Railway, Banking और State PCS के exam pattern में इस तरह के questions common हैं। Answer choose करने के बाद दिया गया explanation जरूर पढ़ें।

Question 42

EN + हिं
GB What is the type of 'nullptr' in C++11?
IN C++11 में 'nullptr' का प्रकार क्या है?
void* खालीपन*
int int यहाँ
std::nullptr_t std::nullptr_t
NULL व्यर्थ
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) nullptr has type std::nullptr_t, which is implicitly convertible to any pointer type or bool.
व्याख्या (हिन्दी) nullptr का प्रकार std::nullptr_t है, जो किसी भी सूचक प्रकार या बूल में अंतर्निहित रूप से परिवर्तनीय है।
🎯 Exam Perspective
यह प्रश्न OOP Using C++ की तैयारी करने वाले अभ्यर्थियों के लिए उपयोगी है। इस तरह के प्रश्न अक्सर SSC CGL, IBPS, RRB और State-level परीक्षाओं जैसी परीक्षाओं में पूछे जाते रहे हैं, इसलिए concept और explanation दोनों को ध्यान से समझें, सिर्फ उत्तर याद न करें।

Question 43

EN + हिं
GB What is the output: double d = 1/3; cout << d;
IN आउटपुट क्या है: डबल डी = 1/3; अदालत
0.333333 0.333333
0.0 0.0
Undefined अपरिभाषित
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) 1/3 is integer division (both operands are int), result is 0. Then 0 is assigned to double d, so d = 0.0.
व्याख्या (हिन्दी) 1/3 पूर्णांक विभाजन है (दोनों ऑपरेंड पूर्णांक हैं), परिणाम 0 है। फिर 0 को डबल डी को सौंपा गया है, इसलिए डी = 0.0।
🎯 Exam Perspective
OOP Using C++ से जुड़ा यह सवाल उन students के लिए काम का है जो UPSC, SSC, Banking और Police भर्ती की तैयारी कर रहे हैं। बेहतर होगा कि explanation पढ़कर concept clear करें, ताकि exam में similar प्रश्न आने पर confusion न हो।

Question 44

EN + हिं
GB What is the result: unsigned char x = 255; x++; cout << x;
IN परिणाम क्या है: अहस्ताक्षरित चार x = 255; एक्स++; अदालत
256 256
255 255
Undefined behavior अपरिभाषित व्यवहार
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) Unsigned integer overflow is well-defined and wraps around: 255+1 = 0 for unsigned char.
व्याख्या (हिन्दी) अहस्ताक्षरित पूर्णांक अतिप्रवाह अच्छी तरह से परिभाषित है और अहस्ताक्षरित चार के लिए 255+1 = 0 के आसपास लपेटता है।
🎯 Exam Perspective
Railway, SSC, Banking और Defence परीक्षाओं जैसी परीक्षाओं में OOP Using C++ से सवाल अक्सर पूछे जाते हैं। इसलिए सिर्फ answer रटने के बजाय, नीचे दी गई explanation को ध्यान से पढ़ें और concept समझें।

Question 45

EN + हिं
GB What does 'auto' deduce for: auto x = {1,2,3};
IN 'ऑटो' किसके लिए निष्कर्ष निकालता है: ऑटो x = {1,2,3};
int[] int[]
std::vector<int> एसटीडी::वेक्टर
std::initializer_list<int> std::initializer_list
Compile error संकलन त्रुटि
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) auto with a braced initializer list deduces std::initializer_list.
व्याख्या (हिन्दी) ब्रेस्ड इनिशियलाइज़र सूची के साथ ऑटो std::initializer_list निकालता है।
🎯 Exam Perspective
अगर आप SSC, Railway, Banking और State PCS की तैयारी कर रहे हैं, तो OOP Using C++ का यह topic आपके लिए महत्वपूर्ण है। Exam में accuracy बढ़ाने के लिए हर सवाल की explanation जरूर पढ़ें।