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 46

EN + हिं
GB What is 'extended precision' floating point?
IN 'विस्तारित परिशुद्धता' फ़्लोटिंग पॉइंट क्या है?
80-bit x87 FPU format used on x86 x86 पर 80-बिट x87 FPU प्रारूप का उपयोग किया गया है
128-bit float 128-बिट फ्लोट
Double precision दोहरी सुनिश्चितता
Quad precision क्वाड परिशुद्धता
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) x87 uses 80-bit extended precision internally; may cause differences when results stored to 64-bit double.
व्याख्या (हिन्दी) x87 आंतरिक रूप से 80-बिट विस्तारित परिशुद्धता का उपयोग करता है; 64-बिट में संग्रहीत परिणाम दोगुने होने पर अंतर हो सकता है।
🎯 Exam Perspective
OOP Using C++ ("Variables and Data Types" sub-topic) के इस प्रश्न को कई प्रतियोगी परीक्षाओं जैसे SSC CGL, IBPS, RRB और State-level परीक्षाओं में repeat होते देखा गया है। Concept clarity के लिए explanation section जरूर पढ़ें।

Question 47

EN + हिं
GB What is the output: auto x=0x1p4; cout<
IN आउटपुट क्या है: ऑटो x=0x1p4; अदालत
16 16
1 1
4 4
Compile error संकलन त्रुटि
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) 0x1p4 = 1 * 2^4 = 16 (hex float literal). Output: 16.
व्याख्या (हिन्दी) 0x1p4 = 1 * 2^4 = 16 (हेक्स फ्लोट शाब्दिक)। आउटपुट: 16.
🎯 Exam Perspective
यह सवाल OOP Using C++ ("Variables and Data Types" sub-topic) category का है, और UPSC, SSC, Banking और Police भर्ती के exam pattern में इस तरह के questions common हैं। Answer choose करने के बाद दिया गया explanation जरूर पढ़ें।

Question 48

EN + हिं
GB What is 'thread_local' storage?
IN 'थ्रेड_लोकल' स्टोरेज क्या है?
Each thread has own instance of the variable प्रत्येक थ्रेड में वेरिएबल का अपना उदाहरण होता है
Shared across threads सभी धागों में साझा किया गया
Atomic variable परमाणु चर
Stack variable स्टैक वैरिएबल
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) thread_local variables are initialized per-thread and destroyed when thread exits.
व्याख्या (हिन्दी) थ्रेड_लोकल वैरिएबल प्रति-थ्रेड प्रारंभ किए जाते हैं और थ्रेड बाहर निकलने पर नष्ट हो जाते हैं।
🎯 Exam Perspective
यह प्रश्न OOP Using C++ ("Variables and Data Types" sub-topic) की तैयारी करने वाले अभ्यर्थियों के लिए उपयोगी है। इस तरह के प्रश्न अक्सर Railway, SSC, Banking और Defence परीक्षाओं जैसी परीक्षाओं में पूछे जाते रहे हैं, इसलिए concept और explanation दोनों को ध्यान से समझें, सिर्फ उत्तर याद न करें।

Question 49

EN + हिं
GB What is the output: int x=5; auto f=[x]()mutable{x+=5; return x;}; cout<
IN आउटपुट क्या है: int x=5; ऑटो f=[x]()mutable{x+=5; वापसी x;}; अदालत
105 105
1010 1010
55 55
Compile error संकलन त्रुटि
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) f() has own copy: x=5+5=10. Outer x=5. C++17 unspecified order: may be 105. Output: 105.
व्याख्या (हिन्दी) f() की अपनी प्रति है: x=5+5=10। बाहरी x=5. C++17 अनिर्दिष्ट क्रम: 105 हो सकता है। आउटपुट: 105।
🎯 Exam Perspective
OOP Using C++ ("Variables and Data Types" sub-topic) से जुड़ा यह सवाल उन students के लिए काम का है जो SSC, Railway, Banking और State PCS की तैयारी कर रहे हैं। बेहतर होगा कि explanation पढ़कर concept clear करें, ताकि exam में similar प्रश्न आने पर confusion न हो।

Question 50

EN + हिं
GB What is 'union' size?
IN 'संघ' का आकार क्या है?
Size of largest member सबसे बड़े सदस्य का आकार
Sum of all members सभी सदस्यों का योग
Size of first member प्रथम सदस्य का आकार
Compiler-defined संकलक-परिभाषित
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) union's size is at least the size of its largest member (plus possible padding for alignment).
व्याख्या (हिन्दी) यूनियन का आकार कम से कम उसके सबसे बड़े सदस्य के आकार (साथ ही संरेखण के लिए संभावित पैडिंग) के बराबर है।
🎯 Exam Perspective
SSC CGL, IBPS, RRB और State-level परीक्षाओं जैसी परीक्षाओं में OOP Using C++ ("Variables and Data Types" sub-topic) से सवाल अक्सर पूछे जाते हैं। इसलिए सिर्फ answer रटने के बजाय, नीचे दी गई explanation को ध्यान से पढ़ें और concept समझें।

Question 51

EN + हिं
GB What is the output: int x=5; cout<
IN आउटपुट क्या है: int x=5; अदालत
i मैं
int int यहाँ
Compile error संकलन त्रुटि
Undefined अपरिभाषित
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) On GCC, typeid(int).name() returns 'i'. Output: i.
व्याख्या (हिन्दी) जीसीसी पर, typeid(int).name() 'i' लौटाता है। आउटपुट: मैं.
🎯 Exam Perspective
अगर आप UPSC, SSC, Banking और Police भर्ती की तैयारी कर रहे हैं, तो OOP Using C++ ("Variables and Data Types" sub-topic) का यह topic आपके लिए महत्वपूर्ण है। Exam में accuracy बढ़ाने के लिए हर सवाल की explanation जरूर पढ़ें।

Question 52

EN + हिं
GB What is 'std::complex' operations?
IN 'std::complex' ऑपरेशन क्या है?
Arithmetic: +,-,*,/ all defined for complex<T> अंकगणित: +,-,*,/ सभी जटिल के लिए परिभाषित
Only addition केवल जोड़
Only for double केवल दोगुने के लिए
Runtime only केवल रनटाइम
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) std::complex supports +,-,*,/ and functions like abs, arg, polar, real, imag.
व्याख्या (हिन्दी) std::complex +,-,*,/ और एब्स, आर्ग, पोलर, रियल, इमेज जैसे कार्यों का समर्थन करता है।
🎯 Exam Perspective
OOP Using C++ ("Variables and Data Types" sub-topic) के इस प्रश्न को कई प्रतियोगी परीक्षाओं जैसे Railway, SSC, Banking और Defence परीक्षाओं में repeat होते देखा गया है। Concept clarity के लिए explanation section जरूर पढ़ें।

Question 53

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

Question 54

EN + हिं
GB What is 'NaN' in floating point?
IN फ्लोटिंग पॉइंट में 'NaN' क्या है?
Not a Number: result of undefined operations like 0.0/0.0 कोई संख्या नहीं: 0.0/0.0 जैसे अपरिभाषित परिचालनों का परिणाम
Negative infinity नकारात्मक अनन्तता
Very small number बहुत छोटी संख्या
Zero शून्य
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) NaN != NaN is always true; use isnan() to check.
व्याख्या (हिन्दी) NaN != NaN सदैव सत्य है; जांचने के लिए इसनान() का उपयोग करें।
🎯 Exam Perspective
यह प्रश्न OOP Using C++ ("Variables and Data Types" sub-topic) की तैयारी करने वाले अभ्यर्थियों के लिए उपयोगी है। इस तरह के प्रश्न अक्सर SSC CGL, IBPS, RRB और State-level परीक्षाओं जैसी परीक्षाओं में पूछे जाते रहे हैं, इसलिए concept और explanation दोनों को ध्यान से समझें, सिर्फ उत्तर याद न करें।

Question 55

EN + हिं
GB What is the output: double x=0.0/0.0; cout<<(x==x);
IN आउटपुट क्या है: डबल x=0.0/0.0; अदालत
1 1
Compile error संकलन त्रुटि
Undefined अपरिभाषित
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) NaN != NaN by IEEE 754. Output: 0.
व्याख्या (हिन्दी) NaN != NaN बाय आईईईई 754. आउटपुट: 0.
🎯 Exam Perspective
OOP Using C++ ("Variables and Data Types" sub-topic) से जुड़ा यह सवाल उन students के लिए काम का है जो UPSC, SSC, Banking और Police भर्ती की तैयारी कर रहे हैं। बेहतर होगा कि explanation पढ़कर concept clear करें, ताकि exam में similar प्रश्न आने पर confusion न हो।

Question 56

EN + हिं
GB What is 'consteval if' in C++23?
IN C++23 में 'consteval if' क्या है?
if consteval: true branch when in constant evaluation context यदि स्थिरता: निरंतर मूल्यांकन संदर्भ में सच्ची शाखा
Same as if constexpr कॉन्स्टेक्सपीआर के समान
Runtime check रनटाइम जांच
A concept संप्रत्यय
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) if consteval allows different code for compile-time vs runtime contexts within constexpr functions.
व्याख्या (हिन्दी) यदि कॉन्स्टेवल कॉन्स्टेक्सपीआर फ़ंक्शंस के भीतर संकलन-समय बनाम रनटाइम संदर्भों के लिए अलग-अलग कोड की अनुमति देता है।
🎯 Exam Perspective
Railway, SSC, Banking और Defence परीक्षाओं जैसी परीक्षाओं में OOP Using C++ ("Variables and Data Types" sub-topic) से सवाल अक्सर पूछे जाते हैं। इसलिए सिर्फ answer रटने के बजाय, नीचे दी गई explanation को ध्यान से पढ़ें और concept समझें।

Question 57

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

Question 58

EN + हिं
GB What is 'std::in_place_t'?
IN 'std::in_place_t' क्या है?
Tag type for in-place construction in optional/variant वैकल्पिक/संस्करण में इन-प्लेस निर्माण के लिए टैग प्रकार
A placement new variant एक प्लेसमेंट नया संस्करण
A lambda tag एक लैम्ब्डा टैग
A concept संप्रत्यय
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) std::in_place enables constructing contained value directly: optional(in_place, args...).
व्याख्या (हिन्दी) std::in_place सीधे निहित मूल्य का निर्माण करने में सक्षम बनाता है: वैकल्पिक (in_place, args...)।
🎯 Exam Perspective
OOP Using C++ ("Variables and Data Types" sub-topic) के इस प्रश्न को कई प्रतियोगी परीक्षाओं जैसे SSC CGL, IBPS, RRB और State-level परीक्षाओं में repeat होते देखा गया है। Concept clarity के लिए explanation section जरूर पढ़ें।

Question 59

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

Question 60

EN + हिं
GB What is 'deduction guide for std::pair'?
IN 'एसटीडी::जोड़ी के लिए कटौती गाइड' क्या है?
pair(T,U)->pair<T,U> enables CTAD युग्म(T,U)->युग्म CTAD को सक्षम बनाता है
Manual template arg मैनुअल टेम्पलेट तर्क
Runtime deduction रनटाइम कटौती
Only for same types केवल एक ही प्रकार के लिए
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) C++17 CTAD: pair p{1, 2.0}; deduces pair via deduction guide.
व्याख्या (हिन्दी) सी++17 सीटीएडी: जोड़ी पी{1, 2.0}; डिडक्शन गाइड के माध्यम से जोड़ी निकाली जाती है।
🎯 Exam Perspective
यह प्रश्न OOP Using C++ ("Variables and Data Types" sub-topic) की तैयारी करने वाले अभ्यर्थियों के लिए उपयोगी है। इस तरह के प्रश्न अक्सर Railway, SSC, Banking और Defence परीक्षाओं जैसी परीक्षाओं में पूछे जाते रहे हैं, इसलिए concept और explanation दोनों को ध्यान से समझें, सिर्फ उत्तर याद न करें।