OOP Using C++ — MCQ Practice

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

📚 187 Questions 🌐 Hindi + English ✅ Free
भाषा / Language:
187 questions
181
EN + हिं
GB What is the output: list l={1,2,3,4,5}; l.remove(3); cout<
IN आउटपुट क्या है: सूची l={1,2,3,4,5}; एल.निकालें(3); अदालत
A
4 4
B
5 5
C
Compile error संकलन त्रुटि
D
Undefined अपरिभाषित
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) Remove 3: {1,2,4,5}. size=4. Output: 4.
व्याख्या (हिन्दी) 3 हटाएँ: {1,2,4,5}। आकार=4. आउटपुट: 4.
182
EN + हिं
GB What is the output: int x=5; cout<<(x>0?to_string(x):"neg");
IN आउटपुट क्या है: int x=5; अदालत
A
5 5
B
neg नकारात्मक
C
Compile error संकलन त्रुटि
D
Undefined अपरिभाषित
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) x>0: to_string(5)="5". Output: 5.
व्याख्या (हिन्दी) x>0: to_string(5)="5". आउटपुट: 5.
183
EN + हिं
GB What is the output: regex r("\\\\d+"); string s="abc123def"; smatch m; regex_search(s,m,r); cout<
IN आउटपुट क्या है: regex r('\\\\d+'); स्ट्रिंग s='abc123def'; स्मैच एम; regex_search(s,m,r); अदालत
A
123 123
B
abc एबीसी
C
Compile error संकलन त्रुटि
D
Undefined अपरिभाषित
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) m[0]="123". Output: 123.
व्याख्या (हिन्दी) एम[0]='123'. आउटपुट: 123.
184
EN + हिं
GB What is the output: auto t=make_tuple(1,string("hi"),3.14); cout<(t)<(t);
IN आउटपुट क्या है: auto t=make_tuple(1,string('hi'),3.14); अदालत
A
1hi 1हाय
B
hi1 नमस्ते1
C
Compile error संकलन त्रुटि
D
Undefined अपरिभाषित
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) get<0>=1, get<1>="hi". Output: 1hi.
व्याख्या (हिन्दी) प्राप्त करें = 1, प्राप्त करें = "हाय"। आउटपुट: 1हाय.
185
EN + हिं
GB What is the output: pair p={42,"hello"}; cout<
IN आउटपुट क्या है: जोड़ी p={42,"हैलो"}; अदालत
A
425 425
B
42hello 42हैलो
C
Compile error संकलन त्रुटि
D
Undefined अपरिभाषित
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) p.first=42, p.second.size()=5. Output: 425.
व्याख्या (हिन्दी) पी.प्रथम=42, पी.सेकेंड.आकार()=5. आउटपुट: 425.
186
EN + हिं
GB What is the output: int x=5; auto y=exchange(x,10); cout<
IN आउटपुट क्या है: int x=5; ऑटो y=एक्सचेंज(x,10); अदालत
A
105 105
B
510 510
C
Compile error संकलन त्रुटि
D
Undefined अपरिभाषित
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) exchange(x,10): returns old=5, sets x=10. Output: 105.
व्याख्या (हिन्दी) एक्सचेंज(x,10): पुराना=5 लौटाता है, x=10 सेट करता है। आउटपुट: 105.
187
EN + हिं
GB What is the output: optional o=5; cout<
IN आउटपुट क्या है: वैकल्पिक o=5; अदालत
A
55 55
B
50 50
C
Compile error संकलन त्रुटि
D
Undefined अपरिभाषित
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) value_or(0)=5; !o=false so *o=5. Output: 55.
व्याख्या (हिन्दी) value_or(0)=5; !o=असत्य अतः *o=5. आउटपुट: 55.
181–187 of 187