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 31

EN + हिं
GB What is the output: int a=1,b=2; cout<
IN आउटपुट क्या है: int a=1,b=2; अदालत
4 4
3 3
Undefined अपरिभाषित
Compile error संकलन त्रुटि
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) a+++b is parsed as (a++)+b = 1+2 = 3 (maximal munch). a becomes 2 after.
व्याख्या (हिन्दी) a+++b को (a++)+b = 1+2 = 3 (अधिकतम चबाना) के रूप में पार्स किया गया है। a बाद में 2 हो जाता है।
🎯 Exam Perspective
OOP Using C++ ("Variables and Data Types" sub-topic) से जुड़ा यह सवाल उन students के लिए काम का है जो SSC, Railway, Banking और State PCS की तैयारी कर रहे हैं। बेहतर होगा कि explanation पढ़कर concept clear करें, ताकि exam में similar प्रश्न आने पर confusion न हो।

Question 32

EN + हिं
GB What is the size of std::byte?
IN एसटीडी::बाइट का आकार क्या है?
1 1
8 8
Platform-dependent प्लेटफार्म पर निर्भर
Same as char चार के समान
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) std::byte (C++17) is defined as an enum class backed by unsigned char, so sizeof(std::byte) == sizeof(unsigned char) == 1.
व्याख्या (हिन्दी) std::byte (C++17) को unsigned char द्वारा समर्थित एक enum क्लास के रूप में परिभाषित किया गया है, इसलिए sizeof(std::byte) == sizeof(unsigned char) == 1.
🎯 Exam Perspective
SSC CGL, IBPS, RRB और State-level परीक्षाओं जैसी परीक्षाओं में OOP Using C++ ("Variables and Data Types" sub-topic) से सवाल अक्सर पूछे जाते हैं। इसलिए सिर्फ answer रटने के बजाय, नीचे दी गई explanation को ध्यान से पढ़ें और concept समझें।

Question 33

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

Question 34

EN + हिं
GB What is 'value category' in C++?
IN C++ में 'मूल्य श्रेणी' क्या है?
lvalue/prvalue/xvalue: classifies expressions lvalue/prvalue/xvalue: भावों को वर्गीकृत करता है
Data type category डेटा प्रकार श्रेणी
Template category टेम्पलेट श्रेणी
Storage class भंडारण वर्ग
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) Value categories determine move/copy semantics and whether address can be taken.
व्याख्या (हिन्दी) मूल्य श्रेणियां चाल/कॉपी शब्दार्थ निर्धारित करती हैं और क्या पता लिया जा सकता है।
🎯 Exam Perspective
OOP Using C++ ("Variables and Data Types" sub-topic) के इस प्रश्न को कई प्रतियोगी परीक्षाओं जैसे SSC CGL, IBPS, RRB और State-level परीक्षाओं में repeat होते देखा गया है। Concept clarity के लिए explanation section जरूर पढ़ें।

Question 35

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

Question 36

EN + हिं
GB What is 'std::numeric_limits::epsilon()'?
IN 'std::numeric_limits::epsilon()' क्या है?
Smallest float difference from 1.0 1.0 से सबसे छोटा फ्लोट अंतर
Machine precision मशीन परिशुद्धता
Float max value फ़्लोट अधिकतम मान
Float min positive फ्लोट न्यूनतम सकारात्मक
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) epsilon is the smallest float e such that 1.0+e != 1.0; ~1.19e-7 for float.
व्याख्या (हिन्दी) एप्सिलॉन सबसे छोटा फ्लोट ई है जैसे कि 1.0+e != 1.0; फ्लोट के लिए ~1.19e-7।
🎯 Exam Perspective
यह प्रश्न OOP Using C++ ("Variables and Data Types" sub-topic) की तैयारी करने वाले अभ्यर्थियों के लिए उपयोगी है। इस तरह के प्रश्न अक्सर Railway, SSC, Banking और Defence परीक्षाओं जैसी परीक्षाओं में पूछे जाते रहे हैं, इसलिए concept और explanation दोनों को ध्यान से समझें, सिर्फ उत्तर याद न करें।

Question 37

EN + हिं
GB What is the output: int x=5; auto y=x; auto& z=x; z=10; cout<
IN आउटपुट क्या है: int x=5; ऑटो y=x; ऑटो& z=x; z=10; अदालत
105 105
1010 1010
55 55
Compile error संकलन त्रुटि
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) z is ref to x; z=10 sets x=10. y is copy=5. Output: 105.
व्याख्या (हिन्दी) z, x का संदर्भ है; z=10 सेट x=10. y प्रतिलिपि = 5 है। आउटपुट: 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 38

EN + हिं
GB What is 'integer literal suffix'?
IN 'पूर्णांक शाब्दिक प्रत्यय' क्या है?
L/LL/U/UL/ULL specifying type of literal एल/एलएल/यू/यूएल/यूएलएल शाब्दिक प्रकार निर्दिष्ट करता है
Hexadecimal prefix हेक्साडेसिमल उपसर्ग
Binary prefix बाइनरी उपसर्ग
Octal prefix अष्टक उपसर्ग
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) 42LL is long long; 42U is unsigned int; 42ULL is unsigned long long.
व्याख्या (हिन्दी) 42LL लंबा लंबा है; 42यू अहस्ताक्षरित पूर्णांक है; 42ULL लंबे समय से अहस्ताक्षरित है।
🎯 Exam Perspective
SSC CGL, IBPS, RRB और State-level परीक्षाओं जैसी परीक्षाओं में OOP Using C++ ("Variables and Data Types" sub-topic) से सवाल अक्सर पूछे जाते हैं। इसलिए सिर्फ answer रटने के बजाय, नीचे दी गई explanation को ध्यान से पढ़ें और concept समझें।

Question 39

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

Question 40

EN + हिं
GB What is 'structured binding' for struct?
IN संरचना के लिए 'संरचित बाइंडिंग' क्या है?
auto [x,y]=myStruct; binds members to names ऑटो [x,y]=myStruct; सदस्यों को नामों से बांधता है
Pointer binding सूचक बाइंडिंग
Reference binding संदर्भ बाइंडिंग
Runtime only केवल रनटाइम
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) C++17: struct A{int x,y;}; A a{1,2}; auto [x,y]=a; gives x=1,y=2.
व्याख्या (हिन्दी) सी++17: संरचना ए{int x,y;}; ए ए{1,2}; ऑटो [x,y]=a; x=1,y=2 देता है।
🎯 Exam Perspective
OOP Using C++ ("Variables and Data Types" sub-topic) के इस प्रश्न को कई प्रतियोगी परीक्षाओं जैसे Railway, SSC, Banking और Defence परीक्षाओं में repeat होते देखा गया है। Concept clarity के लिए explanation section जरूर पढ़ें।

Question 41

EN + हिं
GB What is the output: float f=1.0f/0.0f; cout<
IN आउटपुट क्या है: फ्लोट f=1.0f/0.0f; अदालत
1 1
Compile error संकलन त्रुटि
Undefined अपरिभाषित
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) Float division by zero gives infinity; isinf=true=1. Output: 1.
व्याख्या (हिन्दी) फ्लोट को शून्य से विभाजित करने पर अनंतता मिलती है; inf=सत्य=1. आउटपुट: 1.
🎯 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 42

EN + हिं
GB What is 'std::monostate'?
IN 'std::monostate' क्या है?
Empty type usable as first variant alternative प्रथम प्रकार के विकल्प के रूप में प्रयोग करने योग्य खाली प्रकार
A null type एक शून्य प्रकार
An empty class एक खाली कक्षा
Same as void शून्य के समान
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) std::variant allows default-constructible variant with empty state.
व्याख्या (हिन्दी) std::variant खाली स्थिति के साथ डिफ़ॉल्ट-निर्माण योग्य संस्करण की अनुमति देता है।
🎯 Exam Perspective
यह प्रश्न OOP Using C++ ("Variables and Data Types" sub-topic) की तैयारी करने वाले अभ्यर्थियों के लिए उपयोगी है। इस तरह के प्रश्न अक्सर SSC CGL, IBPS, RRB और State-level परीक्षाओं जैसी परीक्षाओं में पूछे जाते रहे हैं, इसलिए concept और explanation दोनों को ध्यान से समझें, सिर्फ उत्तर याद न करें।

Question 43

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

Question 44

EN + हिं
GB What is 'std::optional::value_or'?
IN 'std::optional::value_or' क्या है?
Returns value if present, else default यदि मौजूद है तो मान लौटाता है, अन्यथा डिफ़ॉल्ट
Throws if empty खाली हो तो फेंक देता है
Same as *opt *ऑप्ट के समान
Converts to bool बूल में परिवर्तित हो जाता है
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) opt.value_or(42) returns opt's value if has_value(), else 42.
व्याख्या (हिन्दी) opt.value_or(42) यदि has_value() है तो opt का मान लौटाता है, अन्यथा 42।
🎯 Exam Perspective
Railway, SSC, Banking और Defence परीक्षाओं जैसी परीक्षाओं में OOP Using C++ ("Variables and Data Types" sub-topic) से सवाल अक्सर पूछे जाते हैं। इसलिए सिर्फ answer रटने के बजाय, नीचे दी गई explanation को ध्यान से पढ़ें और concept समझें।

Question 45

EN + हिं
GB What is the output: int x=1000; char c=x; cout<<(int)c;
IN आउटपुट क्या है: int x=1000; चार सी=एक्स; अदालत
Impl-defined इम्प्लांट-परिभाषित
-24 -24
232 232
Compile error संकलन त्रुटि
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) 1000%256=232 as unsigned; as signed char: 232-256=-24. Implementation-defined.
व्याख्या (हिन्दी) 1000%256=232 अहस्ताक्षरित के रूप में; हस्ताक्षरित वर्ण के अनुसार: 232-256=-24। कार्यान्वयन-परिभाषित।
🎯 Exam Perspective
अगर आप SSC, Railway, Banking और State PCS की तैयारी कर रहे हैं, तो OOP Using C++ ("Variables and Data Types" sub-topic) का यह topic आपके लिए महत्वपूर्ण है। Exam में accuracy बढ़ाने के लिए हर सवाल की explanation जरूर पढ़ें।