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
76
EN + हिं
GB What is the output: int a[5]={1,2,3,4,5}; rotate(a,a+1,a+5); cout<
IN आउटपुट क्या है: int a[5]={1,2,3,4,5}; घुमाएँ(ए,ए+1,ए+5); अदालत
A
21 21
B
15 15
C
Compile error संकलन त्रुटि
D
Undefined अपरिभाषित
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) a[0]=2, a[4]=1. Output: 21.
व्याख्या (हिन्दी) ए[0]=2, ए[4]=1. आउटपुट: 21.
77
EN + हिं
GB What is the output: int a[]={1,2,3,4,5}; reverse(a,a+5); cout<
IN आउटपुट क्या है: int a[]={1,2,3,4,5}; रिवर्स(ए,ए+5); अदालत
A
531 531
B
135 135
C
Compile error संकलन त्रुटि
D
Undefined अपरिभाषित
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) Reversed: {5,4,3,2,1}. a[0]=5,a[2]=3,a[4]=1. Output: 531.
व्याख्या (हिन्दी) उलटा: {5,4,3,2,1}। a[0]=5,a[2]=3,a[4]=1. आउटपुट: 531.
78
EN + हिं
GB What is the output: vector v={1,1,2,2,3,3,4}; cout<
IN आउटपुट क्या है: वेक्टर v={1,1,2,2,3,3,4}; अदालत
A
4 4
B
7 7
C
Compile error संकलन त्रुटि
D
Undefined अपरिभाषित
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) Unique elements: 1,2,3,4 = 4. Output: 4.
व्याख्या (हिन्दी) अद्वितीय तत्व: 1,2,3,4 = 4. आउटपुट: 4.
79
EN + हिं
GB What is the output: int a[]={1,2,3,4,5}; int b[5]; copy_n(rbegin(a),5,b); cout<
IN आउटपुट क्या है: int a[]={1,2,3,4,5}; पूर्णांक बी[5]; Copy_n(rbegin(a),5,b); अदालत
A
5 5
B
1 1
C
Compile error संकलन त्रुटि
D
Undefined अपरिभाषित
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) rbegin(a) starts at 5. b={5,4,3,2,1}. b[0]=5. Output: 5.
व्याख्या (हिन्दी) rbegin(a) 5 से प्रारंभ होता है। b={5,4,3,2,1}। बी[0]=5. आउटपुट: 5.
80
EN + हिं
GB What is the output: int a[]={1,2,3,4,5}; cout<<*min_element(a,a+5)+*max_element(a,a+5);
IN आउटपुट क्या है: int a[]={1,2,3,4,5}; अदालत
A
6 6
B
5 5
C
Compile error संकलन त्रुटि
D
Undefined अपरिभाषित
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) 1+5=6. Output: 6.
व्याख्या (हिन्दी) 1+5=6. आउटपुट: 6.
81
EN + हिं
GB What is the output: vector v={3,1,4,1,5,9,2,6}; sort(v.begin(),v.end()); v.erase(unique(v.begin(),v.end()),v.end()); cout<
IN आउटपुट क्या है: वेक्टर v={3,1,4,1,5,9,2,6}; क्रमबद्ध करें (v.begin(),v.end()); v.erase(unique(v.begin(),v.end()),v.end()); अदालत
A
7 7
B
6 6
C
Compile error संकलन त्रुटि
D
Undefined अपरिभाषित
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) Sorted: 1,1,2,3,4,5,6,9. Unique: 1,2,3,4,5,6,9=7. Output: 7.
व्याख्या (हिन्दी) क्रमबद्ध: 1,1,2,3,4,5,6,9। अद्वितीय: 1,2,3,4,5,6,9=7. आउटपुट: 7.
82
EN + हिं
GB What is the output: int a[]={1,2,3,4,5}; cout<());
IN आउटपुट क्या है: int a[]={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.
83
EN + हिं
GB What is the output: int a[]={1,2,3}; int b[]={4,5,6}; cout<
IN आउटपुट क्या है: int a[]={1,2,3}; int b[]={4,5,6}; अदालत
A
32 32
B
15 15
C
Compile error संकलन त्रुटि
D
Undefined अपरिभाषित
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) 1*4+2*5+3*6=4+10+18=32. Output: 32.
व्याख्या (हिन्दी) 1*4+2*5+3*6=4+10+18=32. आउटपुट: 32.
84
EN + हिं
GB What is the output: array a={5,4,3,2,1}; sort(a.begin(),a.end()); cout<
IN आउटपुट क्या है: array a={5,4,3,2,1}; सॉर्ट करें (a.begin(),a.end()); अदालत
A
15 15
B
51 51
C
Compile error संकलन त्रुटि
D
Undefined अपरिभाषित
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) Sorted: 1,2,3,4,5. a[0]=1,a[4]=5. Output: 15.
व्याख्या (हिन्दी) क्रमबद्ध: 1,2,3,4,5. ए[0]=1,ए[4]=5. आउटपुट: 15.
85
EN + हिं
GB What is the output: int a[]={1,2,3,4,5}; cout<10;});
IN आउटपुट क्या है: int a[]={1,2,3,4,5}; अदालत
A
2 2
B
3 3
C
Compile error संकलन त्रुटि
D
Undefined अपरिभाषित
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) x=4: 16>10; x=5: 25>10. Count=2. But x=3: 9<=10. Output: 2.
व्याख्या (हिन्दी) x=4: 16>10; x=5: 25>10. गिनती=2. लेकिन x=3:9
86
EN + हिं
GB What is the output: int a[]={2,4,6,8,10}; auto it=lower_bound(a,a+5,7); cout<<*it;
IN आउटपुट क्या है: int a[]={2,4,6,8,10}; ऑटो इट=लोअर_बाउंड(ए,ए+5,7); अदालत
A
8 8
B
6 6
C
Compile error संकलन त्रुटि
D
Undefined अपरिभाषित
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) First element >= 7 in {2,4,6,8,10} is 8. Output: 8.
व्याख्या (हिन्दी) {2,4,6,8,10} में पहला तत्व >=7 8 है। आउटपुट: 8।
87
EN + हिं
GB What is the output: vector v={1,2,3,4,5}; v.resize(3); cout<
IN आउटपुट क्या है: वेक्टर v={1,2,3,4,5}; v.आकार बदलें(3); अदालत
A
33 33
B
53 53
C
Compile error संकलन त्रुटि
D
Undefined अपरिभाषित
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) After resize(3): {1,2,3}. size=3,back=3. Output: 33.
व्याख्या (हिन्दी) आकार बदलने के बाद(3): {1,2,3}। आकार = 3, पीछे = 3। आउटपुट: 33.
88
EN + हिं
GB What is the output: int a[]={1,2,3,4,5}; partial_sort(a,a+3,a+5,greater()); cout<
IN आउटपुट क्या है: int a[]={1,2,3,4,5}; आंशिक_सॉर्ट(ए,ए+3,ए+5,अधिकतर()); अदालत
A
543 543
B
123 123
C
Compile error संकलन त्रुटि
D
Undefined अपरिभाषित
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) 3 largest in desc: 5,4,3. Output: 543.
व्याख्या (हिन्दी) विवरण में 3 सबसे बड़ा: 5,4,3। आउटपुट: 543.
89
EN + हिं
GB What is the output: vector v(10); iota(v.begin(),v.end(),1); cout<
IN आउटपुट क्या है: वेक्टर v(10); iota(v.begin(),v.end(),1); अदालत
A
110 110
B
19 19
C
Compile error संकलन त्रुटि
D
Undefined अपरिभाषित
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) v={1..10}. v[0]=1,v[9]=10. Output: 110.
व्याख्या (हिन्दी) वी={1..10}. v[0]=1,v[9]=10. आउटपुट: 110.
90
EN + हिं
GB What is the output: int a[]={1,2,3,4,5}; replace_if(a,a+5,[](int x){return x%2==0;},0); for(int x:a) cout<
IN आउटपुट क्या है: int a[]={1,2,3,4,5}; Replace_if(a,a+5,[](int x){return x%2==0;},0); for(int x:a) कोउट
A
10304 10304
B
12345 12345
C
Compile error संकलन त्रुटि
D
Undefined अपरिभाषित
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) a={1,0,3,0,5}. Output: 10305.
व्याख्या (हिन्दी) ए={1,0,3,0,5}. आउटपुट: 10305.
76–90 of 140