OOP Using C++ — MCQ Practice

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

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

Question 106

EN + हिं
GB What is 'std::underlying_type'?
IN 'std::underlying_type' क्या है?
Gets underlying integer type of enum अंतर्निहित पूर्णांक प्रकार का एनम प्राप्त करता है
Makes enum an int एनम को इंट बनाता है
A cast एक निक्षेपण
Runtime check रनटाइम जांच
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) enum E:short{A}; underlying_type::type = short.
व्याख्या (हिन्दी) एनम ई: लघु {ए}; अंतर्निहित_प्रकार::प्रकार = संक्षिप्त।
🎯 Exam Perspective
OOP Using C++ ("Variables and Data Types" sub-topic) के इस प्रश्न को कई प्रतियोगी परीक्षाओं जैसे SSC, Railway, Banking और State PCS में repeat होते देखा गया है। Concept clarity के लिए explanation section जरूर पढ़ें।

Question 107

EN + हिं
GB What is the output: enum class E:uint8_t{A,B,C}; cout<);
IN आउटपुट क्या है: enum class E:uint8_t{A,B,C}; अदालत
1 1
4 4
Compile error संकलन त्रुटि
Undefined अपरिभाषित
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) uint8_t is 1 byte. Output: 1.
व्याख्या (हिन्दी) uint8_t 1 बाइट है. आउटपुट: 1.
🎯 Exam Perspective
यह सवाल OOP Using C++ ("Variables and Data Types" sub-topic) category का है, और SSC CGL, IBPS, RRB और State-level परीक्षाओं के exam pattern में इस तरह के questions common हैं। Answer choose करने के बाद दिया गया explanation जरूर पढ़ें।

Question 108

EN + हिं
GB What is 'std::aligned_storage'?
IN 'std::aligned_storage' क्या है?
Aligned raw storage for placement new नए प्लेसमेंट के लिए संरेखित कच्चा भंडारण
A smart pointer एक स्मार्ट सूचक
A buffer type एक बफ़र प्रकार
Both B and C बी और सी दोनों
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) aligned_storage::type provides properly aligned storage for T.
व्याख्या (हिन्दी) संरेखित_स्टोरेज::प्रकार टी के लिए उचित रूप से संरेखित भंडारण प्रदान करता है।
🎯 Exam Perspective
यह प्रश्न OOP Using C++ ("Variables and Data Types" sub-topic) की तैयारी करने वाले अभ्यर्थियों के लिए उपयोगी है। इस तरह के प्रश्न अक्सर UPSC, SSC, Banking और Police भर्ती जैसी परीक्षाओं में पूछे जाते रहे हैं, इसलिए concept और explanation दोनों को ध्यान से समझें, सिर्फ उत्तर याद न करें।

Question 109

EN + हिं
GB What is 'std::is_layout_compatible'?
IN 'std::is_layout_compatible' क्या है?
True if two types have same memory layout (C++20) यह सत्य है यदि दो प्रकारों में समान मेमोरी लेआउट है (C++20)
Same as is_same जैसा है वैसा ही है
ABI check एबीआई जांच
Runtime check रनटाइम जांच
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) is_layout_compatible enables safe type punning via memcpy.
व्याख्या (हिन्दी) is_layout_compatible memcpy के माध्यम से सुरक्षित प्रकार की पनिंग को सक्षम बनाता है।
🎯 Exam Perspective
OOP Using C++ ("Variables and Data Types" sub-topic) से जुड़ा यह सवाल उन students के लिए काम का है जो Railway, SSC, Banking और Defence परीक्षाओं की तैयारी कर रहे हैं। बेहतर होगा कि explanation पढ़कर concept clear करें, ताकि exam में similar प्रश्न आने पर confusion न हो।

Question 110

EN + हिं
GB What is the output: int x=5; auto p=reinterpret_cast(&x); cout<<(int)*p;
IN आउटपुट क्या है: int x=5; ऑटो पी=पुनर्व्याख्या_कास्ट(&x); अदालत
5 5
Compile error संकलन त्रुटि
Undefined अपरिभाषित
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) Little-endian: first byte = lowest byte of 5 = 5 (since 5 < 256). Output: 5.
व्याख्या (हिन्दी) लिटिल-एंडियन: पहला बाइट = 5 का सबसे निचला बाइट = 5 (चूंकि 5 <256)। आउटपुट: 5.
🎯 Exam Perspective
SSC, Railway, Banking और State PCS जैसी परीक्षाओं में OOP Using C++ ("Variables and Data Types" sub-topic) से सवाल अक्सर पूछे जाते हैं। इसलिए सिर्फ answer रटने के बजाय, नीचे दी गई explanation को ध्यान से पढ़ें और concept समझें।

Question 111

EN + हिं
GB What is 'std::is_standard_layout'?
IN 'std::is_standard_layout' क्या है?
Type compatible with C struct layout सी संरचना लेआउट के साथ संगत टाइप करें
Same as POD पीओडी के समान
Has virtual आभासी है
Compile error संकलन त्रुटि
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) Standard layout types can be safely passed to C functions and accessed via memcpy.
व्याख्या (हिन्दी) मानक लेआउट प्रकारों को C फ़ंक्शंस में सुरक्षित रूप से पास किया जा सकता है और memcpy के माध्यम से एक्सेस किया जा सकता है।
🎯 Exam Perspective
अगर आप SSC CGL, IBPS, RRB और State-level परीक्षाओं की तैयारी कर रहे हैं, तो OOP Using C++ ("Variables and Data Types" sub-topic) का यह topic आपके लिए महत्वपूर्ण है। Exam में accuracy बढ़ाने के लिए हर सवाल की explanation जरूर पढ़ें।

Question 112

EN + हिं
GB What is the output: struct A{int x; double y;}; cout<;
IN आउटपुट क्या है: struct A{int x; डबल वाई;}; अदालत
1 1
Compile error संकलन त्रुटि
Undefined अपरिभाषित
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) No virtual, no mixed access specifiers. Standard layout = 1. Output: 1.
व्याख्या (हिन्दी) कोई वर्चुअल, कोई मिश्रित एक्सेस विनिर्देशक नहीं। मानक लेआउट = 1. आउटपुट: 1.
🎯 Exam Perspective
OOP Using C++ ("Variables and Data Types" sub-topic) के इस प्रश्न को कई प्रतियोगी परीक्षाओं जैसे UPSC, SSC, Banking और Police भर्ती में repeat होते देखा गया है। Concept clarity के लिए explanation section जरूर पढ़ें।

Question 113

EN + हिं
GB What is 'std::has_unique_object_representations'?
IN 'std::has_unique_object_repretations' क्या है?
True if type has unique bit pattern per value (no padding bits) यह सत्य है यदि प्रकार में प्रति मान अद्वितीय बिट पैटर्न है (कोई पैडिंग बिट नहीं)
Always true for int इंट के लिए हमेशा सच है
Float check फ़्लोट चेक
Runtime check रनटाइम जांच
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) True for char, int (usually); false for float (NaN), structs with padding.
व्याख्या (हिन्दी) चार, इंट (आमतौर पर) के लिए सच है; फ्लोट (NaN) के लिए गलत, पैडिंग के साथ संरचनाएं।
🎯 Exam Perspective
यह सवाल OOP Using C++ ("Variables and Data Types" sub-topic) category का है, और Railway, SSC, Banking और Defence परीक्षाओं के exam pattern में इस तरह के questions common हैं। Answer choose करने के बाद दिया गया explanation जरूर पढ़ें।

Question 114

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

Question 115

EN + हिं
GB What is 'std::integer_sequence' usage pattern?
IN 'std::integer_sequence' उपयोग पैटर्न क्या है?
index_sequence used to unpack tuples in templates Index_sequence का उपयोग टेम्प्लेट में टुपल्स को अनपैक करने के लिए किया जाता है
Runtime index रनटाइम इंडेक्स
Loop replacement लूप प्रतिस्थापन
A container कंटेनर
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) make_index_sequence generates 0,1,...,N-1 for use with std::get(tuple).
व्याख्या (हिन्दी) make_index_sequence std::get(tuple) के साथ उपयोग के लिए 0,1,...,N-1 उत्पन्न करता है।
🎯 Exam Perspective
OOP Using C++ ("Variables and Data Types" sub-topic) से जुड़ा यह सवाल उन students के लिए काम का है जो SSC CGL, IBPS, RRB और State-level परीक्षाओं की तैयारी कर रहे हैं। बेहतर होगा कि explanation पढ़कर concept clear करें, ताकि exam में similar प्रश्न आने पर confusion न हो।

Question 116

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

Question 117

EN + हिं
GB What is 'std::bool_constant'?
IN 'std::bool_constant' क्या है?
Alias for integral_constant<bool,B> इंटीग्रल_कॉन्स्टेंट के लिए उपनाम
A bool wrapper एक बूल रैपर
Same as bool बूल के समान
Compile-time bool संकलन-समय बूल
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) true_type=bool_constant; false_type=bool_constant.
व्याख्या (हिन्दी) true_type=bool_constant; false_type=bool_constant.
🎯 Exam Perspective
अगर आप Railway, SSC, Banking और Defence परीक्षाओं की तैयारी कर रहे हैं, तो OOP Using C++ ("Variables and Data Types" sub-topic) का यह topic आपके लिए महत्वपूर्ण है। Exam में accuracy बढ़ाने के लिए हर सवाल की explanation जरूर पढ़ें।

Question 118

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

Question 119

EN + हिं
GB What is 'std::conjunction' and 'std::disjunction'?
IN 'std::conjunction' और 'std::disjunction' क्या है?
Short-circuit logical AND/OR on type traits शॉर्ट-सर्किट तार्किक और/या प्रकार के लक्षणों पर
Same as &&/|| &&/|| के समान
Runtime operations रनटाइम संचालन
Concept equivalents संकल्पना समकक्ष
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) conjunction is A::value && B::value && C::value evaluated lazily.
व्याख्या (हिन्दी) संयोजन A::value && B::value && C::value का मूल्यांकन आलस्यपूर्वक किया गया है।
🎯 Exam Perspective
यह सवाल OOP Using C++ ("Variables and Data Types" sub-topic) category का है, और SSC CGL, IBPS, RRB और State-level परीक्षाओं के exam pattern में इस तरह के questions common हैं। Answer choose करने के बाद दिया गया explanation जरूर पढ़ें।

Question 120

EN + हिं
GB What is the output: cout<<;
IN आउटपुट क्या है: cout
01 01
10 10
Compile error संकलन त्रुटि
Undefined अपरिभाषित
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) conjunction=T&&T&&F=0; disjunction=F||T=1. Output: 01.
व्याख्या (हिन्दी) संयोजन=T&&T&&F=0; विच्छेदन=F||T=1. आउटपुट: 01.
🎯 Exam Perspective
यह प्रश्न OOP Using C++ ("Variables and Data Types" sub-topic) की तैयारी करने वाले अभ्यर्थियों के लिए उपयोगी है। इस तरह के प्रश्न अक्सर UPSC, SSC, Banking और Police भर्ती जैसी परीक्षाओं में पूछे जाते रहे हैं, इसलिए concept और explanation दोनों को ध्यान से समझें, सिर्फ उत्तर याद न करें।