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 121

EN + हिं
GB What is 'std::make_signed' and 'std::make_unsigned'?
IN 'std::make_signed' और 'std::make_unsigned' क्या है?
Convert integer type to signed/unsigned equivalent पूर्णांक प्रकार को हस्ताक्षरित/अहस्ताक्षरित समकक्ष में बदलें
Cast operators कास्ट ऑपरेटर
Runtime conversion रनटाइम रूपांतरण
Type erasure मिटाना टाइप करें
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) make_signed_t=int; make_unsigned_t=unsigned int.
व्याख्या (हिन्दी) make_signed_t=int; make_unsigned_t=unsigned int.
🎯 Exam Perspective
OOP Using C++ ("Variables and Data Types" sub-topic) से जुड़ा यह सवाल उन students के लिए काम का है जो Railway, SSC, Banking और Defence परीक्षाओं की तैयारी कर रहे हैं। बेहतर होगा कि explanation पढ़कर concept clear करें, ताकि exam में similar प्रश्न आने पर confusion न हो।

Question 122

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

Question 123

EN + हिं
GB What is 'std::conditional_t'?
IN 'std::conditional_t' क्या है?
Selects T or F based on bool condition at compile time संकलन समय पर बूल स्थिति के आधार पर टी या एफ का चयन करता है
Runtime if-else रनटाइम यदि-अन्यथा
A ternary operator एक टर्नरी ऑपरेटर
Same as enable_if Enable_if के समान
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) conditional_t=int; conditional_t=double.
व्याख्या (हिन्दी) सशर्त_t=int; सशर्त_टी=दोगुना।
🎯 Exam Perspective
अगर आप SSC CGL, IBPS, RRB और State-level परीक्षाओं की तैयारी कर रहे हैं, तो OOP Using C++ ("Variables and Data Types" sub-topic) का यह topic आपके लिए महत्वपूर्ण है। Exam में accuracy बढ़ाने के लिए हर सवाल की explanation जरूर पढ़ें।

Question 124

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

Question 125

EN + हिं
GB What is 'std::void_t'?
IN 'std::void_t' क्या है?
Maps any types to void; used for SFINAE detection शून्य करने के लिए किसी भी प्रकार के मानचित्र; SFINAE का पता लगाने के लिए उपयोग किया जाता है
A void alias एक शून्य उपनाम
Removes types प्रकार हटाता है
A concept संप्रत्यय
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) void_t fails if T has no 'type' member; enables has_type_member trait.
व्याख्या (हिन्दी) यदि T में कोई 'प्रकार' सदस्य नहीं है तो void_t विफल हो जाता है; has_type_member विशेषता को सक्षम करता है।
🎯 Exam Perspective
यह सवाल OOP Using C++ ("Variables and Data Types" sub-topic) category का है, और Railway, SSC, Banking और Defence परीक्षाओं के exam pattern में इस तरह के questions common हैं। Answer choose करने के बाद दिया गया explanation जरूर पढ़ें।

Question 126

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

Question 127

EN + हिं
GB What is the output: int x=5; auto& r=x; const auto& cr=x; cout<
IN आउटपुट क्या है: int x=5; ऑटो&r=x; स्थिरांक ऑटो& cr=x; अदालत
55 55
Compile error संकलन त्रुटि
Undefined अपरिभाषित
50 50
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) Both read x=5. Output: 55.
व्याख्या (हिन्दी) दोनों x=5 पढ़ते हैं। आउटपुट: 55.
🎯 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 128

EN + हिं
GB What is the output: volatile int x=5; cout<
IN आउटपुट क्या है: volatile int x=5; अदालत
5 5
Undefined अपरिभाषित
Compile error संकलन त्रुटि
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) volatile doesn't change value; just forces memory read. Output: 5.
व्याख्या (हिन्दी) अस्थिर मूल्य नहीं बदलता है; बस स्मृति को पढ़ने पर मजबूर करता है। आउटपुट: 5.
🎯 Exam Perspective
UPSC, SSC, Banking और Police भर्ती जैसी परीक्षाओं में OOP Using C++ ("Variables and Data Types" sub-topic) से सवाल अक्सर पूछे जाते हैं। इसलिए सिर्फ answer रटने के बजाय, नीचे दी गई explanation को ध्यान से पढ़ें और concept समझें।

Question 129

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

Question 130

EN + हिं
GB What is the output: int x=5; decltype(auto) r=x; r=10; cout<
IN आउटपुट क्या है: int x=5; डिक्लटाइप(ऑटो) r=x; आर=10; अदालत
5 5
10 10
Compile error संकलन त्रुटि
Undefined अपरिभाषित
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) decltype(auto) r=x deduces int (not ref, since x is lvalue expression). r is int. r=10 doesn't affect x. Output: 5. Wait: decltype(x) is int, so r is int copy. x=5. Actually decltype(auto) of a plain name is int, not int&. Output: 5.
व्याख्या (हिन्दी) decltype(auto) r=x int को घटाता है (रेफ नहीं, क्योंकि x लैवल्यू एक्सप्रेशन है)। आर पूर्णांक है. r=10 x को प्रभावित नहीं करता. आउटपुट: 5. प्रतीक्षा करें: decltype(x) int है, इसलिए r int कॉपी है। एक्स=5. वास्तव में सादे नाम का डिक्लटाइप (ऑटो) int है, int& नहीं। आउटपुट: 5.
🎯 Exam Perspective
OOP Using C++ ("Variables and Data Types" sub-topic) के इस प्रश्न को कई प्रतियोगी परीक्षाओं जैसे SSC, Railway, Banking और State PCS में repeat होते देखा गया है। Concept clarity के लिए explanation section जरूर पढ़ें।

Question 131

EN + हिं
GB What is the output: int x=5,y=10; auto [a,b]=make_pair(x,y); a=99; cout<
IN आउटपुट क्या है: int x=5,y=10; ऑटो [ए,बी]=मेक_पेयर(एक्स,वाई); ए=99; अदालत
510 510
9910 9910
Compile error संकलन त्रुटि
Undefined अपरिभाषित
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) a is copy; a=99 doesn't affect x. b=10. Output: 510.
व्याख्या (हिन्दी) ए प्रतिलिपि है; a=99 x को प्रभावित नहीं करता. बी=10. आउटपुट: 510.
🎯 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 132

EN + हिं
GB What is the output: int x=5; int& r=x; auto y=r; y=99; cout<
IN आउटपुट क्या है: int x=5; int& r=x; ऑटो y=r; y=99; अदालत
5 5
99 99
Compile error संकलन त्रुटि
Undefined अपरिभाषित
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) auto y=r: strips reference, y is int copy. y=99 doesn't affect x. Output: 5.
व्याख्या (हिन्दी) ऑटो y=r: स्ट्रिप्स संदर्भ, y इंट कॉपी है। y=99 x को प्रभावित नहीं करता. आउटपुट: 5.
🎯 Exam Perspective
यह प्रश्न OOP Using C++ ("Variables and Data Types" sub-topic) की तैयारी करने वाले अभ्यर्थियों के लिए उपयोगी है। इस तरह के प्रश्न अक्सर UPSC, SSC, Banking और Police भर्ती जैसी परीक्षाओं में पूछे जाते रहे हैं, इसलिए concept और explanation दोनों को ध्यान से समझें, सिर्फ उत्तर याद न करें।

Question 133

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

Question 134

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

Question 135

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