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 91

EN + हिं
GB What is 'std::type_identity'?
IN 'std::type_identity' क्या है?
Identity type trait: type_identity<T>::type = T पहचान प्रकार विशेषता: type_identity::type = T
Removes const स्थिरांक हटाता है
Adds reference संदर्भ जोड़ता है
Decays type क्षय प्रकार
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) type_identity prevents deduction: f(type_identity_t) requires explicit T.
व्याख्या (हिन्दी) type_identity कटौती को रोकता है: f(type_identity_t) को स्पष्ट T की आवश्यकता होती है।
🎯 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 92

EN + हिं
GB What is the output: int x=1000000; long long y=x*x; cout<
IN आउटपुट क्या है: int x=1000000; लंबा लंबा y=x*x; अदालत
1000000000000 100000000000
Undefined behavior अपरिभाषित व्यवहार
1000000 1000000
Compile error संकलन त्रुटि
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) x*x computed as int: 1e6*1e6=1e12 overflows int. UB before assignment to long long.
व्याख्या (हिन्दी) x*x की गणना int के रूप में की जाती है: 1e6*1e6=1e12 int ओवरफ्लो करता है। लंबे समय तक असाइनमेंट से पहले यूबी।
🎯 Exam Perspective
UPSC, SSC, Banking और Police भर्ती जैसी परीक्षाओं में OOP Using C++ ("Variables and Data Types" sub-topic) से सवाल अक्सर पूछे जाते हैं। इसलिए सिर्फ answer रटने के बजाय, नीचे दी गई explanation को ध्यान से पढ़ें और concept समझें।

Question 93

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

Question 94

EN + हिं
GB What is 'std::to_chars' vs 'std::to_string'?
IN 'std::to_chars' बनाम 'std::to_string' क्या है?
to_chars: no allocation, faster; to_string: allocates string to_chars: कोई आवंटन नहीं, तेज़; to_string: स्ट्रिंग आवंटित करता है
Same performance वही प्रदर्शन
to_string is faster to_string तेज़ है
to_chars throws to_chars फेंकता है
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) std::to_chars writes to a char buffer without allocation; to_string returns a new string.
व्याख्या (हिन्दी) std::to_chars आवंटन के बिना एक चार बफर को लिखता है; to_string एक नई स्ट्रिंग लौटाता है।
🎯 Exam Perspective
OOP Using C++ ("Variables and Data Types" sub-topic) के इस प्रश्न को कई प्रतियोगी परीक्षाओं जैसे SSC, Railway, Banking और State PCS में repeat होते देखा गया है। Concept clarity के लिए explanation section जरूर पढ़ें।

Question 95

EN + हिं
GB What is the output: char buf[10]; auto [ptr,ec]=to_chars(buf,buf+10,42); *ptr=0; cout<
IN आउटपुट क्या है: char buf[10]; ऑटो [ptr,ec]=to_chars(buf,buf+10,42); *पीटीआर=0; अदालत
42 42
Compile error संकलन त्रुटि
Undefined अपरिभाषित
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) to_chars writes '4','2'; null-terminate; cout<
व्याख्या (हिन्दी) to_chars '4','2' लिखता है; शून्य-समाप्त; अदालत
🎯 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 96

EN + हिं
GB What is 'std::from_chars'?
IN 'std::from_chars' क्या है?
Parses number from char buffer without locale/allocation स्थान/आवंटन के बिना चार बफ़र से संख्या पार्स करता है
Same as stoi स्टोइ के समान
Throws on error त्रुटि पर फेंकता है
Returns string स्ट्रिंग लौटाता है
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) from_chars(&buf[0],&buf[n],x) parses integer/float efficiently.
व्याख्या (हिन्दी) from_chars(&buf[0],&buf[n],x) कुशलतापूर्वक पूर्णांक/फ्लोट को पार्स करता है।
🎯 Exam Perspective
यह प्रश्न OOP Using C++ ("Variables and Data Types" sub-topic) की तैयारी करने वाले अभ्यर्थियों के लिए उपयोगी है। इस तरह के प्रश्न अक्सर UPSC, SSC, Banking और Police भर्ती जैसी परीक्षाओं में पूछे जाते रहे हैं, इसलिए concept और explanation दोनों को ध्यान से समझें, सिर्फ उत्तर याद न करें।

Question 97

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

Question 98

EN + हिं
GB What is 'std::remove_cvref_t'?
IN 'std::remove_cvref_t' क्या है?
Removes const, volatile, and reference from type प्रकार से स्थिरांक, अस्थिर और संदर्भ हटाता है
Removes pointer सूचक हटाता है
Adds const स्थिरांक जोड़ता है
Same as decay क्षय के समान
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) remove_cvref_t = int.
व्याख्या (हिन्दी) हटाएं_cvref_t = int.
🎯 Exam Perspective
SSC, Railway, Banking और State PCS जैसी परीक्षाओं में OOP Using C++ ("Variables and Data Types" sub-topic) से सवाल अक्सर पूछे जाते हैं। इसलिए सिर्फ answer रटने के बजाय, नीचे दी गई explanation को ध्यान से पढ़ें और concept समझें।

Question 99

EN + हिं
GB What is the output: cout<,int>;
IN आउटपुट क्या है: cout
1 1
Compile error संकलन त्रुटि
Undefined अपरिभाषित
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) Removes const and &. Result=int. is_same=1. Output: 1.
व्याख्या (हिन्दी) स्थिरांक और & को हटाता है। परिणाम=अंत. समान=1 है. आउटपुट: 1.
🎯 Exam Perspective
अगर आप SSC CGL, IBPS, RRB और State-level परीक्षाओं की तैयारी कर रहे हैं, तो OOP Using C++ ("Variables and Data Types" sub-topic) का यह topic आपके लिए महत्वपूर्ण है। Exam में accuracy बढ़ाने के लिए हर सवाल की explanation जरूर पढ़ें।

Question 100

EN + हिं
GB What is 'std::type_traits is_trivially_destructible'?
IN 'std::type_traits is_trivially_destructible' क्या है?
True if destructor is trivial (no user-defined dtor) सत्य है यदि विध्वंसक तुच्छ है (कोई उपयोगकर्ता-परिभाषित dtor नहीं)
True for all types सभी प्रकार के लिए सच है
False for POD पीओडी के लिए गलत
Compile-time check संकलन-समय की जाँच
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) is_trivially_destructible::value=true; class with user dtor=false.
व्याख्या (हिन्दी) is_trivially_destructible::value=true; उपयोगकर्ता के साथ वर्ग dtor=झूठा।
🎯 Exam Perspective
OOP Using C++ ("Variables and Data Types" sub-topic) के इस प्रश्न को कई प्रतियोगी परीक्षाओं जैसे UPSC, SSC, Banking और Police भर्ती में repeat होते देखा गया है। Concept clarity के लिए explanation section जरूर पढ़ें।

Question 101

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

Question 102

EN + हिं
GB What is 'std::common_type'?
IN 'std::common_type' क्या है?
Deduces common type of multiple types कई प्रकार के सामान्य प्रकार का अनुमान लगाता है
Smallest type सबसे छोटा प्रकार
Largest type सबसे बड़ा प्रकार
Most general type सबसे सामान्य प्रकार
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) common_type::type = double (arithmetic conversion).
व्याख्या (हिन्दी) सामान्य_प्रकार::प्रकार = दोहरा (अंकगणितीय रूपांतरण)।
🎯 Exam Perspective
यह प्रश्न OOP Using C++ ("Variables and Data Types" sub-topic) की तैयारी करने वाले अभ्यर्थियों के लिए उपयोगी है। इस तरह के प्रश्न अक्सर SSC, Railway, Banking और State PCS जैसी परीक्षाओं में पूछे जाते रहे हैं, इसलिए concept और explanation दोनों को ध्यान से समझें, सिर्फ उत्तर याद न करें।

Question 103

EN + हिं
GB What is the output: cout<,double>;
IN आउटपुट क्या है: cout
1 1
Compile error संकलन त्रुटि
Undefined अपरिभाषित
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) int+double promotes to double. is_same=1. Output: 1.
व्याख्या (हिन्दी) int+double दोगुना करने को बढ़ावा देता है। समान=1 है. आउटपुट: 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 104

EN + हिं
GB What is 'std::is_aggregate'?
IN 'std::is_aggregate' क्या है?
True if type is aggregate (no user-provided ctor, no private/protected) यदि प्रकार समग्र है तो सही है (कोई उपयोगकर्ता द्वारा प्रदत्त सीटीओआर नहीं, कोई निजी/संरक्षित नहीं)
True for all structs सभी संरचनाओं के लिए सच है
False for arrays सरणियों के लिए गलत
Runtime check रनटाइम जांच
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) is_aggregate is a compile-time check using type traits.
व्याख्या (हिन्दी) is_aggregate प्रकार के लक्षणों का उपयोग करके एक संकलन-समय जांच है।
🎯 Exam Perspective
UPSC, SSC, Banking और Police भर्ती जैसी परीक्षाओं में OOP Using C++ ("Variables and Data Types" sub-topic) से सवाल अक्सर पूछे जाते हैं। इसलिए सिर्फ answer रटने के बजाय, नीचे दी गई explanation को ध्यान से पढ़ें और concept समझें।

Question 105

EN + हिं
GB What is the output: struct A{int x,y;}; cout<<;
IN आउटपुट क्या है: struct A{int x,y;}; अदालत
10 10
11 11
Compile error संकलन त्रुटि
Undefined अपरिभाषित
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) A is aggregate=1; string has user-provided ctors=0. Output: 10.
व्याख्या (हिन्दी) ए समुच्चय=1 है; स्ट्रिंग में उपयोगकर्ता द्वारा प्रदत्त ctors=0 है। आउटपुट: 10.
🎯 Exam Perspective
अगर आप Railway, SSC, Banking और Defence परीक्षाओं की तैयारी कर रहे हैं, तो OOP Using C++ ("Variables and Data Types" sub-topic) का यह topic आपके लिए महत्वपूर्ण है। Exam में accuracy बढ़ाने के लिए हर सवाल की explanation जरूर पढ़ें।