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
1621
EN + हिं
GB What is the output: int a[]={1,2,3,4,5}; cout<());
IN आउटपुट क्या है: int a[]={1,2,3,4,5}; अदालत
B
1 1
C
Compile error संकलन त्रुटि
D
Undefined अपरिभाषित
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) 1<2: not descending. Output: 0.
व्याख्या (हिन्दी) 1
1622
EN + हिं
GB What is the output: array a; iota(a.begin(),a.end(),2); cout<
IN आउटपुट क्या है: array a; iota(a.begin(),a.end(),2); अदालत
A
26 26
B
15 15
C
Compile error संकलन त्रुटि
D
Undefined अपरिभाषित
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) a={2,3,4,5,6}. a[0]=2,a[4]=6. Output: 26.
व्याख्या (हिन्दी) ए={2,3,4,5,6}। ए[0]=2,ए[4]=6. आउटपुट: 26.
1623
EN + हिं
GB What is the output: int a[]={1,2,3,4,5}; copy_if(a,a+5,ostream_iterator(cout,' '),[](int x){return x*x>8;});
IN आउटपुट क्या है: int a[]={1,2,3,4,5}; Copy_if(a,a+5,ostream_iterator(cout,' '),[](int x){return x*x>8;});
A
3 4 5 3 4 5
B
4 5 4 5
C
Compile error संकलन त्रुटि
D
Undefined अपरिभाषित
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) 3^2=9>8, 4^2=16>8, 5^2=25>8. Output: 3 4 5.
व्याख्या (हिन्दी) 3^2=9>8, 4^2=16>8, 5^2=25>8. आउटपुट: 3 4 5.
1624
EN + हिं
GB What is the output: int a[]={0,1,0,1,1,0}; cout<
IN आउटपुट क्या है: int a[]={0,1,0,1,1,0}; अदालत
A
3 3
B
2 2
C
Compile error संकलन त्रुटि
D
Undefined अपरिभाषित
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) Three 1s. Output: 3.
व्याख्या (हिन्दी) तीन 1s. आउटपुट: 3.
1625
EN + हिं
GB What is the output: int a[]={1,2,3,4,5}; int b[]={5,4,3,2,1}; cout<
IN आउटपुट क्या है: int a[]={1,2,3,4,5}; int b[]={5,4,3,2,1}; अदालत
B
1 1
C
Compile error संकलन त्रुटि
D
Undefined अपरिभाषित
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) Not equal. Output: 0.
व्याख्या (हिन्दी) सम नही। आउटपुट: 0.
1626
EN + हिं
GB What is the output: vector v={1,2,3,4,5}; v.assign(3,9); cout<
IN आउटपुट क्या है: वेक्टर v={1,2,3,4,5}; v.असाइन(3,9); अदालत
A
39 39
B
59 59
C
Compile error संकलन त्रुटि
D
Undefined अपरिभाषित
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) Replaces with 3 copies of 9. size=3, v[0]=9. Output: 39.
व्याख्या (हिन्दी) 9 की 3 प्रतियों से प्रतिस्थापित। आकार=3, v[0]=9। आउटपुट: 39.
1627
EN + हिं
GB What is the output: int a[]={2,4,8,16,32}; cout<
IN आउटपुट क्या है: int a[]={2,4,8,16,32}; अदालत
A
5 5
C
Compile error संकलन त्रुटि
D
Undefined अपरिभाषित
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) All pairs are doubling. adjacent_find returns end=a+5. Distance=5. Output: 5.
व्याख्या (हिन्दी) सभी जोड़े दोगुने हो रहे हैं। आसन्न_खोज अंत=ए+5 लौटाता है। दूरी=5. आउटपुट: 5.
1628
EN + हिं
GB What is the output: int a[]={1,2,3,4,5}; int s=transform_reduce(a,a+5,0,plus<>(),[](int x){return x%2;});cout<
IN आउटपुट क्या है: int a[]={1,2,3,4,5}; int s=transform_reduce(a,a+5,0,plus(),[](int x){return x%2;});cout
A
3 3
B
2 2
C
Compile error संकलन त्रुटि
D
Undefined अपरिभाषित
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) Odd elements: 1,3,5 contribute 1 each; evens 0. Sum=3. Output: 3.
व्याख्या (हिन्दी) विषम तत्व: 1,3,5 प्रत्येक 1 का योगदान करते हैं; समताएँ 0. योग=3. आउटपुट: 3.
1629
EN + हिं
GB What is the output: vector v={1,2,3,4,5}; stable_partition(v.begin(),v.end(),[](int x){return x%2==0;}); cout<
IN आउटपुट क्या है: वेक्टर v={1,2,3,4,5}; स्थिर_विभाजन(v.begin(),v.end(),[](int x){वापसी x%2==0;}); अदालत
A
25 25
B
15 15
C
Compile error संकलन त्रुटि
D
Undefined अपरिभाषित
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) Evens first: {2,4,1,3,5}. v[0]=2,v[4]=5. Output: 25.
व्याख्या (हिन्दी) पहले सम: {2,4,1,3,5}। v[0]=2,v[4]=5. आउटपुट: 25.
1630
EN + हिं
GB What is the output: int a[]={3,3,3,3,3}; cout<<*min_element(a,a+5)<<*max_element(a,a+5);
IN आउटपुट क्या है: int a[]={3,3,3,3,3}; अदालत
A
33 33
B
3 3 3 3
C
Compile error संकलन त्रुटि
D
Undefined अपरिभाषित
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) All 3. min=3,max=3. Output: 33.
व्याख्या (हिन्दी) सभी 3. न्यूनतम=3,अधिकतम=3. आउटपुट: 33.
1631
EN + हिं
GB What is the output: vector v={1,2,3,4,5}; rotate(v.begin(),v.end()-1,v.end()); cout<
IN आउटपुट क्या है: वेक्टर v={1,2,3,4,5}; रोटेट(v.begin(),v.end()-1,v.end()); अदालत
A
51 51
B
45 45
C
Compile error संकलन त्रुटि
D
Undefined अपरिभाषित
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) After rotate: v[0]=5,v[4]=4. Output: 54.
व्याख्या (हिन्दी) घुमाने के बाद: v[0]=5,v[4]=4. आउटपुट: 54.
1632
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.
1633
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.
1634
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.
1635
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.
1621–1635 of 1915