OOP Using C++ — MCQ Practice

Hindi aur English dono mein practice karo — click karo answer check karne ke liye

📚 1915 Questions 🌐 Hindi + English ✅ Free
भाषा / Language:
1915 questions
1171
EN + हिं
GB What is the output: cout<<;
IN आउटपुट क्या है: cout
A
01 01
B
10 10
C
Compile error संकलन त्रुटि
D
Undefined अपरिभाषित
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) conjunction=T&&T&&F=0; disjunction=F||T=1. Output: 01.
व्याख्या (हिन्दी) संयोजन=T&&T&&F=0; विच्छेदन=F||T=1. आउटपुट: 01.
1172
EN + हिं
GB What is 'std::make_signed' and 'std::make_unsigned'?
IN 'std::make_signed' और 'std::make_unsigned' क्या है?
A
Convert integer type to signed/unsigned equivalent पूर्णांक प्रकार को हस्ताक्षरित/अहस्ताक्षरित समकक्ष में बदलें
B
Cast operators कास्ट ऑपरेटर
C
Runtime conversion रनटाइम रूपांतरण
D
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.
1173
EN + हिं
GB What is the output: cout<,unsigned int>;
IN आउटपुट क्या है: cout
A
1 1
C
Compile error संकलन त्रुटि
D
Undefined अपरिभाषित
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) make_unsigned_t=unsigned int. is_same=1. Output: 1.
व्याख्या (हिन्दी) make_unsigned_t=unsigned int. समान=1 है. आउटपुट: 1.
1174
EN + हिं
GB What is 'std::conditional_t'?
IN 'std::conditional_t' क्या है?
A
Selects T or F based on bool condition at compile time संकलन समय पर बूल स्थिति के आधार पर टी या एफ का चयन करता है
B
Runtime if-else रनटाइम यदि-अन्यथा
C
A ternary operator एक टर्नरी ऑपरेटर
D
Same as enable_if Enable_if के समान
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) conditional_t=int; conditional_t=double.
व्याख्या (हिन्दी) सशर्त_t=int; सशर्त_टी=दोगुना।
1175
EN + हिं
GB What is the output: using T=conditional_t<(sizeof(int)>2),int,short>; cout<
IN आउटपुट क्या है: T=conditional_t2),int,short> का उपयोग करना; अदालत
A
4 4
B
2 2
C
Compile error संकलन त्रुटि
D
Undefined अपरिभाषित
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) sizeof(int)=4>2: true; T=int; sizeof=4. Output: 4.
व्याख्या (हिन्दी) sizeof(int)=4>2: सत्य; टी=इंट; आकार=4. आउटपुट: 4.
1176
EN + हिं
GB What is 'std::void_t'?
IN 'std::void_t' क्या है?
A
Maps any types to void; used for SFINAE detection शून्य करने के लिए किसी भी प्रकार के मानचित्र; SFINAE का पता लगाने के लिए उपयोग किया जाता है
B
A void alias एक शून्य उपनाम
C
Removes types प्रकार हटाता है
D
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 विशेषता को सक्षम करता है।
1177
EN + हिं
GB What is the output: int x=-5; cout<<(x>>1);
IN आउटपुट क्या है: int x=-5; cout1);
A
Implementation-defined कार्यान्वयन-परिभाषित
B
-3 -3
C
-2 -2
D
Compile error संकलन त्रुटि
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) See explanation.
व्याख्या (हिन्दी) स्पष्टीकरण देखें.
1178
EN + हिं
GB What is the output: int x=5; cout<<(x<=5&&x>=5);
IN आउटपुट क्या है: int x=5; अदालत
A
1 1
C
Compile error संकलन त्रुटि
D
Undefined अपरिभाषित
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) Both true. 1&&1=1. Output: 1.
व्याख्या (हिन्दी) दोनों सच. 1&&1=1. आउटपुट: 1.
1179
EN + हिं
GB What is the output: int x=7; cout<<(x&0xF0)>>4;
IN आउटपुट क्या है: int x=7; cout4;
B
7 7
C
Compile error संकलन त्रुटि
D
Undefined अपरिभाषित
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) 7=0000 0111. 7&0xF0=0. 0>>4=0. Output: 0.
व्याख्या (हिन्दी) 7=0000 0111. 7&0xF0=0. 0>>4=0. आउटपुट: 0.
1180
EN + हिं
GB What is the output: int a=5,b=3; cout<<(a>b)-(a
IN आउटपुट क्या है: int a=5,b=3; अदालत
A
1 1
C
-1 -1
D
Compile error संकलन त्रुटि
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) 5>3=1, 5<3=0. 1-0=1. Output: 1.
व्याख्या (हिन्दी) 5>3=1, 5
1181
EN + हिं
GB What is 'operator<=> auto' return?
IN 'ऑपरेटर ऑटो' रिटर्न क्या है?
A
Compiler deduces comparison category from member comparisons कंपाइलर सदस्य तुलनाओं से तुलना श्रेणी निकालता है
B
Always strong_ordering हमेशा मजबूत_आदेश देना
C
Runtime deduction रनटाइम कटौती
D
Same as bool बूल के समान
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) auto operator<=>(const A&)const=default; deduces weakest category of member types.
व्याख्या (हिन्दी) ऑटो ऑपरेटर(स्थिरांक A&) स्थिरांक=डिफ़ॉल्ट; सदस्य प्रकारों की सबसे कमजोर श्रेणी निकालता है।
1182
EN + हिं
GB What is the output: int x=5; x=x>3?(x<10?x*2:x):x/2; cout<
IN आउटपुट क्या है: int x=5; x=x>3?(x
A
10 10
B
5 5
C
2 2
D
Compile error संकलन त्रुटि
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) x>3=true; x<10=true; x=5*2=10. Output: 10.
व्याख्या (हिन्दी) x>3=सत्य; एक्स
1183
EN + हिं
GB What is the output: int x=5,y=3; int z=x>y?x-y:y-x; cout<
IN आउटपुट क्या है: int x=5,y=3; int z=x>y?x-y:y-x; अदालत
A
2 2
B
8 8
C
Compile error संकलन त्रुटि
D
Undefined अपरिभाषित
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) x>y: z=5-3=2. Output: 2.
व्याख्या (हिन्दी) x>y: z=5-3=2. आउटपुट: 2.
1184
EN + हिं
GB What is the output: int x=5; cout<<(x*2>>1);
IN आउटपुट क्या है: int x=5; cout1);
A
5 5
B
10 10
C
Compile error संकलन त्रुटि
D
Undefined अपरिभाषित
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) 5*2=10; 10>>1=5. Output: 5.
व्याख्या (हिन्दी) 5*2=10; 10>>1=5. आउटपुट: 5.
1185
EN + हिं
GB What is the output: int x=0b1111; x&=0b1010; cout<
IN आउटपुट क्या है: int x=0b1111; x&=0b1010; अदालत
A
10 10
B
15 15
C
5 5
D
Compile error संकलन त्रुटि
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) 1111&1010=1010=10. Output: 10.
व्याख्या (हिन्दी) 1111&1010=1010=10. आउटपुट: 10.
1171–1185 of 1915