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
76
EN + हिं
GB What is 'std::numeric_limits::digits'?
IN 'std::numeric_limits::digits' क्या है?
A
Number of binary digits (bits-1 for signed) बाइनरी अंकों की संख्या (हस्ताक्षरित के लिए बिट्स-1)
B
Total bits कुल बिट्स
C
Decimal digits दशमलव अंक
D
Significant digits महत्वपूर्ण अंक
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) digits for signed int=31 (excludes sign bit); for unsigned int=32.
व्याख्या (हिन्दी) हस्ताक्षरित int=31 के लिए अंक (साइन बिट को छोड़कर); अहस्ताक्षरित int=32 के लिए।
77
EN + हिं
GB What is the output: int x=5; cout<<(x*2==10)<<(x/2==2)<<(x%2==1);
IN आउटपुट क्या है: int x=5; अदालत
A
111 111
B
110 110
C
011 011
D
Compile error संकलन त्रुटि
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) 10==10=1, 2==2=1, 1==1=1. Output: 111.
व्याख्या (हिन्दी) 10==10=1, 2==2=1, 1==1=1. आउटपुट: 111.
78
EN + हिं
GB What is 'volatile const' combination?
IN 'वाष्पशील स्थिरांक' संयोजन क्या है?
A
Read-only variable whose value may change externally केवल पढ़ने योग्य वैरिएबल जिसका मान बाह्य रूप से बदल सकता है
B
Useless combination बेकार संयोजन
C
Compile error संकलन त्रुटि
D
Same as const स्थिरांक के समान
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) const volatile int reg: can't modify in code but hardware may change it; must read from memory each time.
व्याख्या (हिन्दी) const volatile int reg: कोड में संशोधन नहीं किया जा सकता लेकिन हार्डवेयर इसे बदल सकता है; हर बार याददाश्त से पढ़ना चाहिए।
79
EN + हिं
GB What is the output: int x=-5; cout<
IN आउटपुट क्या है: int x=-5; अदालत
A
5 5
B
-5 -5
C
Compile error संकलन त्रुटि
D
Undefined अपरिभाषित
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) std::abs(-5)=5. Output: 5.
व्याख्या (हिन्दी) std::abs(-5)=5. आउटपुट: 5.
80
EN + हिं
GB What is 'std::tuple_size'?
IN 'std::tuple_size' क्या है?
A
Compile-time number of elements in tuple/pair/array टपल/जोड़ी/सरणी में तत्वों की संकलन-समय संख्या
B
Runtime size रनटाइम आकार
C
Iterator count पुनरावर्तक गिनती
D
Type count गिनती टाइप करें
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) tuple_size>::value = 3 at compile time.
व्याख्या (हिन्दी) संकलन समय पर Tuple_size::value = 3।
81
EN + हिं
GB What is the output: auto x=3.14; auto y=3.14f; cout<<(sizeof(x)==sizeof(y));
IN आउटपुट क्या है: ऑटो x=3.14; ऑटो y=3.14f; अदालत
B
1 1
C
Compile error संकलन त्रुटि
D
Undefined अपरिभाषित
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) sizeof(double)=8, sizeof(float)=4. 8==4=false=0. Output: 0.
व्याख्या (हिन्दी) आकार(डबल)=8, आकार(फ्लोट)=4. 8==4=असत्य=0. आउटपुट: 0.
82
EN + हिं
GB What is 'std::get(tuple)'?
IN 'std::get(tuple)' क्या है?
A
Access Nth element of tuple at compile time संकलन समय पर टुपल के Nवें तत्व तक पहुंचें
B
Runtime element access रनटाइम तत्व पहुंच
C
Type-erased access टाइप-मिटाई गई पहुंच
D
Iterator access इटरेटर पहुंच
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) auto t=make_tuple(1,2.0,'a'); std::get<1>(t)=2.0.
व्याख्या (हिन्दी) ऑटो t=make_tuple(1,2.0,'a'); std::get(t)=2.0.
83
EN + हिं
GB What is the output: auto t=make_tuple(1,2.0,'A'); cout<(t)<(t);
IN आउटपुट क्या है: auto t=make_tuple(1,2.0,'A'); अदालत
A
1A 1 क
B
12 12
C
Compile error संकलन त्रुटि
D
Undefined अपरिभाषित
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) get<0>=1, get<2>='A'. Output: 1A.
व्याख्या (हिन्दी) प्राप्त करें = 1, प्राप्त करें = 'ए'। आउटपुट: 1ए.
84
EN + हिं
GB What is 'std::variant::visit'?
IN 'std::variant::visit' क्या है?
A
Calls correct overload for currently held type वर्तमान में रखे गए प्रकार के लिए सही ओवरलोड कॉल करता है
B
Runtime type switch रनटाइम प्रकार स्विच
C
Dynamic dispatch गतिशील प्रेषण
D
Same as get जैसा मिलता है वैसा ही
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) std::visit(overloaded{...}, v) applies the matching handler for the active type in v.
व्याख्या (हिन्दी) std::visit(overloaded{...}, v) v में सक्रिय प्रकार के लिए मिलान हैंडलर लागू करता है।
85
EN + हिं
GB What is the output: variant v=3.14; cout<(v);
IN आउटपुट क्या है: वैरिएंट v=3.14; अदालत
A
1 1
C
Compile error संकलन त्रुटि
D
Undefined अपरिभाषित
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) v holds double. holds_alternative(v)=true=1. Output: 1.
व्याख्या (हिन्दी) v दोगुना रखता है। धारक_वैकल्पिक(v)=सत्य=1. आउटपुट: 1.
86
EN + हिं
GB What is the output: int x=5; decltype(x) y=10; cout<
IN आउटपुट क्या है: int x=5; घोषणापत्र(x) y=10; अदालत
A
4 4
B
8 8
C
Compile error संकलन त्रुटि
D
Undefined अपरिभाषित
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) decltype(x)=int. sizeof(int)=4. Output: 4.
व्याख्या (हिन्दी) decltype(x)=int. sizeof(int)=4. आउटपुट: 4.
87
EN + हिं
GB What is the output: auto x=1; auto y=2u; cout<<(x+y);
IN आउटपुट क्या है: ऑटो x=1; ऑटो y=2u; अदालत
A
3 3
B
Undefined अपरिभाषित
C
Compile error संकलन त्रुटि
D
-1 -1
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) x converted to unsigned; 1+2=3. Output: 3.
व्याख्या (हिन्दी) x को अहस्ताक्षरित में परिवर्तित किया गया; 1+2=3. आउटपुट: 3.
88
EN + हिं
GB What is 'std::integral_constant'?
IN 'std::integral_constant' क्या है?
A
Compile-time constant value as a type एक प्रकार के रूप में संकलन-समय स्थिर मान
B
A runtime constant एक रनटाइम स्थिरांक
C
A variable template एक परिवर्तनीय टेम्पलेट
D
A typedef एक टाइपडिफ़
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) integral_constant::value=5; used in TMP to pass values as types.
व्याख्या (हिन्दी) अभिन्न_स्थिरांक::मान=5; TMP में मानों को प्रकारों के रूप में पारित करने के लिए उपयोग किया जाता है।
89
EN + हिं
GB What is the output: constexpr auto x=1<=>2; cout<<(x<0);
IN आउटपुट क्या है: constexpr auto x=12; अदालत
A
1 1
C
Compile error संकलन त्रुटि
D
Undefined अपरिभाषित
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) 1<2 so strong_ordering::less < 0 = true = 1. Output: 1.
व्याख्या (हिन्दी) 1
90
EN + हिं
GB What is the output: int x=5; auto y=static_cast(x)/2; cout<
IN आउटपुट क्या है: int x=5; ऑटो y=static_cast(x)/2; अदालत
A
2.5 2.5
B
2 2
C
Compile error संकलन त्रुटि
D
Undefined अपरिभाषित
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) 5.0/2=2.5. Output: 2.5.
व्याख्या (हिन्दी) 5.0/2=2.5. आउटपुट: 2.5.
76–90 of 160