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
166
EN + हिं
GB What is the output: vector v={"a","bb","ccc"}; cout<
IN आउटपुट क्या है: वेक्टर v={"a","bb","ccc"}; अदालत
A
abbccc abbcc
B
accc ए सी सी सी
C
Compile error संकलन त्रुटि
D
Undefined अपरिभाषित
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) "a"+"bb"+"ccc"="abbccc". Output: abbccc.
व्याख्या (हिन्दी) "ए"+"बीबी"+"सीसीसी"='एबीबीसीसीसी''। आउटपुट: एबीबीसीसीसी।
167
EN + हिं
GB What is the output: auto s=string(5,'x'); cout<
IN आउटपुट क्या है: auto s=string(5,'x'); अदालत
A
xxxxx xxxxx
B
x एक्स
C
Compile error संकलन त्रुटि
D
Undefined अपरिभाषित
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) 5 copies of 'x'. Output: xxxxx.
व्याख्या (हिन्दी) 'x' की 5 प्रतियाँ। आउटपुट: xxxxx.
168
EN + हिं
GB What is the output: string s="abcdef"; cout<
IN आउटपुट क्या है: स्ट्रिंग s='abcdef'; अदालत
A
cde सीडीई
B
abc एबीसी
C
Compile error संकलन त्रुटि
D
Undefined अपरिभाषित
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) Start=2, length=3: c,d,e. Output: cde.
व्याख्या (हिन्दी) प्रारंभ=2, लंबाई=3: सी,डी,ई। आउटपुट: सीडीई.
169
EN + हिं
170
EN + हिं
GB What is the output: cout<
IN आउटपुट क्या है: cout
A
0.143 0.143
B
0.14 0.14
C
Compile error संकलन त्रुटि
D
Undefined अपरिभाषित
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) 1/7≈0.14285... rounded to 3=0.143. Output: 0.143.
व्याख्या (हिन्दी) 1/7≈0.14285... को 3=0.143 तक पूर्णांकित किया गया। आउटपुट: 0.143.
171
EN + हिं
GB What is the output: int x=5; auto f=[]()->decltype(x){return x*2;}; cout<
IN आउटपुट क्या है: int x=5; ऑटो f=[]()->decltype(x){रिटर्न x*2;}; अदालत
A
10 10
B
5 5
C
Compile error संकलन त्रुटि
D
Undefined अपरिभाषित
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) f()=x*2=10. Output: 10.
व्याख्या (हिन्दी) f()=x*2=10. आउटपुट: 10.
172
EN + हिं
GB What is the output: int x=0; auto inc=[&x](int n=1){x+=n;}; inc(); inc(5); cout<
IN आउटपुट क्या है: int x=0; ऑटो इंक=[&x](int n=1){x+=n;}; inc(); इंक(5); अदालत
A
6 6
B
1 1
C
Compile error संकलन त्रुटि
D
Undefined अपरिभाषित
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) x+=1=1; x+=5=6. Output: 6.
व्याख्या (हिन्दी) x+=1=1; x+=5=6. आउटपुट: 6.
173
EN + हिं
GB What is the output: vector v={1,2,3,4,5}; cout<
IN आउटपुट क्या है: वेक्टर v={1,2,3,4,5}; अदालत
A
5 5
B
6 6
C
Compile error संकलन त्रुटि
D
Undefined अपरिभाषित
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) 1*5=5. Output: 5.
व्याख्या (हिन्दी) 1*5=5. आउटपुट: 5.
174
EN + हिं
GB What is the output: deque d={1,2,3}; d.push_front(0); d.push_back(4); cout<
IN आउटपुट क्या है: deque d={1,2,3}; d.push_front(0); d.push_back(4); अदालत
A
045 045
B
145 145
C
Compile error संकलन त्रुटि
D
Undefined अपरिभाषित
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) front=0, back=4, size=5. Output: 045.
व्याख्या (हिन्दी) आगे=0, पीछे=4, आकार=5. आउटपुट: 045.
175
EN + हिं
GB What is the output: map m; m["a"]=1; m["b"]=2; m["c"]=3; cout<
IN आउटपुट क्या है: मानचित्र एम; एम["ए"]=1; एम["बी"]=2; एम["सी"]=3; अदालत
A
23 23
B
32 32
C
Compile error संकलन त्रुटि
D
Undefined अपरिभाषित
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) m["b"]=2, size=3. Output: 23.
व्याख्या (हिन्दी) m["b"]=2, size=3. आउटपुट: 23.
176
EN + हिं
GB What is the output: set s={3,1,4,1,5,9,2,6}; cout<
IN आउटपुट क्या है: सेट s={3,1,4,1,5,9,2,6}; अदालत
A
71 71
B
81 81
C
Compile error संकलन त्रुटि
D
Undefined अपरिभाषित
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) Unique: {1,2,3,4,5,6,9}=7. First=1. Output: 71.
व्याख्या (हिन्दी) अद्वितीय: {1,2,3,4,5,6,9}=7. प्रथम=1. आउटपुट: 71.
177
EN + हिं
GB What is the output: unordered_map m; for(int i=1;i<=5;i++) m[i]=i*i; cout<
IN आउटपुट क्या है: unordered_map m; for(int i=1;i
A
9 9
B
3 3
C
Compile error संकलन त्रुटि
D
Undefined अपरिभाषित
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) m[3]=9. Output: 9.
व्याख्या (हिन्दी) एम[3]=9. आउटपुट: 9.
178
EN + हिं
GB What is the output: stack s; s.push(1);s.push(2);s.push(3); cout<
IN आउटपुट क्या है: स्टैक एस; एस.पुश(1);एस.पुश(2);एस.पुश(3); अदालत
A
32 32
B
12 12
C
Compile error संकलन त्रुटि
D
Undefined अपरिभाषित
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) top=3; pop; top=2. Output: 32.
व्याख्या (हिन्दी) शीर्ष=3; जल्दी से आना; शीर्ष=2. आउटपुट: 32.
179
EN + हिं
GB What is the output: queue q; q.push(1);q.push(2);q.push(3); cout<
IN आउटपुट क्या है: क्यू क्यू; q.पुश(1);q.पुश(2);q.पुश(3); अदालत
A
12 12
B
32 32
C
Compile error संकलन त्रुटि
D
Undefined अपरिभाषित
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) front=1; pop; front=2. Output: 12.
व्याख्या (हिन्दी) सामने=1; जल्दी से आना; सामने=2. आउटपुट: 12.
180
EN + हिं
GB What is the output: priority_queue pq; pq.push(3);pq.push(1);pq.push(4);pq.push(2); cout<
IN आउटपुट क्या है: प्राथमिकता_क्यू पीक्यू; pq.push(3);pq.push(1);pq.push(4);pq.push(2); अदालत
A
4 4
B
3 3
C
Compile error संकलन त्रुटि
D
Undefined अपरिभाषित
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) Max heap: top=4. Output: 4.
व्याख्या (हिन्दी) अधिकतम ढेर: शीर्ष=4. आउटपुट: 4.
166–180 of 187