OOP Using C++ — MCQ Practice

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

📚 140 Questions 🌐 Hindi + English ✅ Free
भाषा / Language:
140 questions
136
EN + हिं
GB What is the output: int a[]={5,4,3,2,1}; make_heap(begin(a),end(a),greater()); cout<
IN आउटपुट क्या है: int a[]={5,4,3,2,1}; make_heap(शुरू(a),end(a),greater()); अदालत
A
1 1
B
5 5
C
Compile error संकलन त्रुटि
D
Undefined अपरिभाषित
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) greater() makes min-heap. a[0]=1. Output: 1.
व्याख्या (हिन्दी) ग्रेटर() मिन-हीप बनाता है। ए[0]=1. आउटपुट: 1.
137
EN + हिं
GB What is the output: int a[]={1,2,3,4,5}; next_permutation(a,a+5); next_permutation(a,a+5); cout<
IN आउटपुट क्या है: int a[]={1,2,3,4,5}; अगला_क्रमपरिवर्तन(ए,ए+5); अगला_क्रमपरिवर्तन(ए,ए+5); अदालत
A
54 54
B
45 45
C
Compile error संकलन त्रुटि
D
Undefined अपरिभाषित
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) 1st next: {1,2,3,5,4}; 2nd next: {1,2,4,3,5}. a[3]=3,a[4]=5. Output: 35.
व्याख्या (हिन्दी) पहला अगला: {1,2,3,5,4}; दूसरा अगला: {1,2,4,3,5}। ए[3]=3,ए[4]=5. आउटपुट: 35.
138
EN + हिं
GB What is the output: vector v={1,2,2,3,3,3}; mapfreq; for(int x:v) freq[x]++; cout<
IN आउटपुट क्या है: वेक्टर v={1,2,2,3,3,3}; मैपफ्रीक; for(int x:v) freq[x]++; अदालत
A
3 3
B
2 2
C
Compile error संकलन त्रुटि
D
Undefined अपरिभाषित
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) 3 appears 3 times. Output: 3.
व्याख्या (हिन्दी) 3 3 बार प्रकट होता है. आउटपुट: 3.
139
EN + हिं
GB What is the output: int a[]={1,2,3,4,5}; auto r=ranges::max_element(a); cout<<*r;
IN आउटपुट क्या है: int a[]={1,2,3,4,5}; ऑटो r=श्रेणियाँ::max_element(a); अदालत
A
5 5
B
1 1
C
Compile error संकलन त्रुटि
D
Undefined अपरिभाषित
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) Max=5. Output: 5.
व्याख्या (हिन्दी) अधिकतम=5. आउटपुट: 5.
140
EN + हिं
GB What is the output: vector v={1,2,3,4,5}; cout<{});
IN आउटपुट क्या है: वेक्टर v={1,2,3,4,5}; अदालत
A
120 120
B
15 15
C
Compile error संकलन त्रुटि
D
Undefined अपरिभाषित
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) 1*1*2*3*4*5=120. Output: 120.
व्याख्या (हिन्दी) 1*1*2*3*4*5=120. आउटपुट: 120.
136–140 of 140