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 61

EN + हिं
GB What is the output: unsigned x=10; int y=-1; cout<<(x+y);
IN आउटपुट क्या है: unsigned x=10; int y=-1; अदालत
9 9
Undefined अपरिभाषित
Compile error संकलन त्रुटि
UINT_MAX+9 UINT_MAX+9
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) y=-1 converted to unsigned=UINT_MAX. 10+UINT_MAX wraps: UINT_MAX+11... wait: 10+(UINT_MAX)=UINT_MAX+10 which wraps to 9 (since UINT_MAX+1=0, UINT_MAX+10=9). Output: 9.
व्याख्या (हिन्दी) y=-1 को अहस्ताक्षरित=UINT_MAX में परिवर्तित किया गया। 10+UINT_MAX रैप्स: UINT_MAX+11... प्रतीक्षा करें: 10+(UINT_MAX)=UINT_MAX+10 जो 9 तक रैप होता है (चूंकि UINT_MAX+1=0, UINT_MAX+10=9)। आउटपुट: 9.
🎯 Exam Perspective
OOP Using C++ ("Variables and Data Types" sub-topic) से जुड़ा यह सवाल उन students के लिए काम का है जो SSC, Railway, Banking और State PCS की तैयारी कर रहे हैं। बेहतर होगा कि explanation पढ़कर concept clear करें, ताकि exam में similar प्रश्न आने पर confusion न हो।

Question 62

EN + हिं
GB What is 'std::byte to integer' conversion?
IN 'std::बाइट से पूर्णांक' रूपांतरण क्या है?
std::to_integer<int>(b) — explicit conversion std::to_integer(b) - स्पष्ट रूपांतरण
Implicit cast निहित कास्ट
reinterpret_cast पुनर्व्याख्या_कास्ट
C-style cast सी-स्टाइल कास्ट
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) std::to_integer(b) explicitly converts std::byte to integer type.
व्याख्या (हिन्दी) std::to_integer(b) स्पष्ट रूप से std::byte को पूर्णांक प्रकार में परिवर्तित करता है।
🎯 Exam Perspective
SSC CGL, IBPS, RRB और State-level परीक्षाओं जैसी परीक्षाओं में OOP Using C++ ("Variables and Data Types" sub-topic) से सवाल अक्सर पूछे जाते हैं। इसलिए सिर्फ answer रटने के बजाय, नीचे दी गई explanation को ध्यान से पढ़ें और concept समझें।

Question 63

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

Question 64

EN + हिं
GB What is 'std::variant::index()'?
IN 'std::variant::index()' क्या है?
Returns index of currently held type वर्तमान में रखे गए प्रकार का सूचकांक लौटाता है
Returns value मान लौटाता है
Returns type name प्रकार का नाम लौटाता है
Returns size आकार लौटाता है
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) variant v=3.14; v.index() returns 2 (double is 3rd type, 0-indexed).
व्याख्या (हिन्दी) वैरिएंट v=3.14; v.index() रिटर्न 2 (डबल तीसरा प्रकार है, 0-अनुक्रमित)।
🎯 Exam Perspective
OOP Using C++ ("Variables and Data Types" sub-topic) के इस प्रश्न को कई प्रतियोगी परीक्षाओं जैसे Railway, SSC, Banking और Defence परीक्षाओं में repeat होते देखा गया है। Concept clarity के लिए explanation section जरूर पढ़ें।

Question 65

EN + हिं
GB What is the output: int a=5,b=3; cout<
IN आउटपुट क्या है: int a=5,b=3; अदालत
15 15
8 8
5 5
Compile error संकलन त्रुटि
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) max of initializer_list: max is 15=a*b. Output: 15.
व्याख्या (हिन्दी) इनिशियलाइज़र_लिस्ट की अधिकतम सीमा: अधिकतम 15=a*b है। आउटपुट: 15.
🎯 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 66

EN + हिं
GB What is 'scoped enum' (enum class)?
IN 'स्कोप्ड एनम' (एनम क्लास) क्या है?
Enum values scoped to enum name; no implicit int conversion Enum मानों का दायरा enum नाम तक सीमित है; कोई अंतर्निहित अंतर रूपांतरण नहीं
Same as regular enum नियमित एनम के समान
A class with enum members एनम सदस्यों वाला एक वर्ग
Template enum टेम्प्लेट एनम
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) enum class Color{Red,Green}; requires Color::Red; no implicit conversion to int.
व्याख्या (हिन्दी) एनम वर्ग रंग {लाल, हरा}; रंग की आवश्यकता है::लाल; int में कोई अंतर्निहित रूपांतरण नहीं।
🎯 Exam Perspective
यह प्रश्न OOP Using C++ ("Variables and Data Types" sub-topic) की तैयारी करने वाले अभ्यर्थियों के लिए उपयोगी है। इस तरह के प्रश्न अक्सर SSC CGL, IBPS, RRB और State-level परीक्षाओं जैसी परीक्षाओं में पूछे जाते रहे हैं, इसलिए concept और explanation दोनों को ध्यान से समझें, सिर्फ उत्तर याद न करें।

Question 67

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

Question 68

EN + हिं
GB What is 'std::any::type()'?
IN 'std::any::type()' क्या है?
Returns type_info of stored value संग्रहित मूल्य का type_info लौटाता है
Returns size आकार लौटाता है
Returns string name स्ट्रिंग नाम लौटाता है
Checks if empty जाँचता है कि क्या खाली है
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) any a=42; a.type()==typeid(int) — true.
व्याख्या (हिन्दी) कोई भी a=42; a.type()==typeid(int) — सत्य।
🎯 Exam Perspective
Railway, SSC, Banking और Defence परीक्षाओं जैसी परीक्षाओं में OOP Using C++ ("Variables and Data Types" sub-topic) से सवाल अक्सर पूछे जाते हैं। इसलिए सिर्फ answer रटने के बजाय, नीचे दी गई explanation को ध्यान से पढ़ें और concept समझें।

Question 69

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

Question 70

EN + हिं
GB What is 'constexpr variable'?
IN 'constexpr वैरिएबल' क्या है?
Compile-time constant value संकलन-समय स्थिर मान
Runtime constant रनटाइम स्थिरांक
Static variable स्थैतिक चर
Same as const स्थिरांक के समान
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) constexpr int x=42; evaluated at compile time; can be used in constant expressions.
व्याख्या (हिन्दी) constexpr int x=42; संकलन समय पर मूल्यांकन किया गया; स्थिर अभिव्यक्तियों में उपयोग किया जा सकता है।
🎯 Exam Perspective
OOP Using C++ ("Variables and Data Types" sub-topic) के इस प्रश्न को कई प्रतियोगी परीक्षाओं जैसे SSC CGL, IBPS, RRB और State-level परीक्षाओं में repeat होते देखा गया है। Concept clarity के लिए explanation section जरूर पढ़ें।

Question 71

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

Question 72

EN + हिं
GB What is 'std::clamp' in C++17?
IN C++17 में 'std::clamp' क्या है?
Clamps value to [lo,hi] range क्लैंप का मान [लो,हाय] रेंज तक है
Rounds to nearest निकटतम तक पूर्णांकित करता है
Absolute value पूर्ण मूल्य
Saturation arithmetic संतृप्ति अंकगणित
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) std::clamp(x,lo,hi) returns lo if xhi, else x.
व्याख्या (हिन्दी) std::clamp(x,lo,hi) यदि xhi है तो वापस लौटता है, अन्यथा x पर।
🎯 Exam Perspective
यह प्रश्न OOP Using C++ ("Variables and Data Types" sub-topic) की तैयारी करने वाले अभ्यर्थियों के लिए उपयोगी है। इस तरह के प्रश्न अक्सर Railway, SSC, Banking और Defence परीक्षाओं जैसी परीक्षाओं में पूछे जाते रहे हैं, इसलिए concept और explanation दोनों को ध्यान से समझें, सिर्फ उत्तर याद न करें।

Question 73

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

Question 74

EN + हिं
GB What is 'integer sequence' std::integer_sequence?
IN 'पूर्णांक अनुक्रम' std::integer_sequence क्या है?
Compile-time sequence of integers for template metaprogramming टेम्प्लेट मेटाप्रोग्रामिंग के लिए पूर्णांकों का संकलन-समय अनुक्रम
Runtime sequence रनटाइम अनुक्रम
A container कंटेनर
A tuple variant एक टुपल वैरिएंट
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) std::integer_sequence encodes a sequence for use with index_sequence tricks.
व्याख्या (हिन्दी) std::integer_sequence, Index_sequence ट्रिक्स के साथ उपयोग के लिए एक अनुक्रम को एनकोड करता है।
🎯 Exam Perspective
SSC CGL, IBPS, RRB और State-level परीक्षाओं जैसी परीक्षाओं में OOP Using C++ ("Variables and Data Types" sub-topic) से सवाल अक्सर पूछे जाते हैं। इसलिए सिर्फ answer रटने के बजाय, नीचे दी गई explanation को ध्यान से पढ़ें और concept समझें।

Question 75

EN + हिं
GB What is the output: int x=5; auto [a,b]=[x,x*2]; cout<
IN आउटपुट क्या है: int x=5; ऑटो [ए,बी]=[एक्स,एक्स*2]; अदालत
Compile error संकलन त्रुटि
510 510
55 55
Undefined अपरिभाषित
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) [x,x*2] is not valid C++ array/aggregate syntax for structured binding. Compile error.
व्याख्या (हिन्दी) [x,x*2] संरचित बाइंडिंग के लिए मान्य C++ सरणी/एग्रीगेट सिंटैक्स नहीं है। संकलन त्रुटि.
🎯 Exam Perspective
अगर आप UPSC, SSC, Banking और Police भर्ती की तैयारी कर रहे हैं, तो OOP Using C++ ("Variables and Data Types" sub-topic) का यह topic आपके लिए महत्वपूर्ण है। Exam में accuracy बढ़ाने के लिए हर सवाल की explanation जरूर पढ़ें।