OOP Using C++ — MCQ Practice

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

📚 133 Questions 🌐 Hindi + English ✅ Free
भाषा / Language:
133 questions
31
EN + हिं
GB What is the output: int x=5; if(x) { int x=10; cout<
IN आउटपुट क्या है: int x=5; यदि(x) { int x=10; अदालत
A
105 105
B
1010 1010
C
55 55
D
Compile error संकलन त्रुटि
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) Inner block has its own x=10 (shadows outer). Prints 10 inside block, then outer x=5. Output: 105.
व्याख्या (हिन्दी) आंतरिक ब्लॉक का अपना x=10 (बाहरी छाया) होता है। ब्लॉक के अंदर 10 प्रिंट करता है, फिर बाहरी x=5 प्रिंट करता है। आउटपुट: 105.
32
EN + हिं
GB What is the output: int x=5; (x>3)?cout<<'Y':cout<<'N';
IN आउटपुट क्या है: int x=5; (x>3)?काउट
A
Y वाई
B
N एन
C
Compile error संकलन त्रुटि
D
Undefined अपरिभाषित
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) x>3=true; cout<<'Y'. Output: Y.
व्याख्या (हिन्दी) x>3=सत्य; अदालत
33
EN + हिं
GB What is the output: for(int i=0;i<3;i++) cout<
IN आउटपुट क्या है: for(int i=0;i
A
014 014
B
012 012
C
Compile error संकलन त्रुटि
D
Undefined अपरिभाषित
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) 0,1,4. Output: 014.
व्याख्या (हिन्दी) 0,1,4. आउटपुट: 014.
34
EN + हिं
GB What is the output: int x=5; switch(x){case 5: cout<
IN आउटपुट क्या है: int x=5; स्विच(x){केस 5: कॉउट
A
56 56
B
55 55
C
Compile error संकलन त्रुटि
D
Undefined अपरिभाषित
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) case 5: x++=5(x=6), fallthrough to case 6: x=6. Output: 56.
व्याख्या (हिन्दी) केस 5: x++=5(x=6), केस 6: x=6 तक। आउटपुट: 56.
35
EN + हिं
GB 'What is the output: int i=5; do{cout<
IN 'आउटपुट क्या है: int i=5; करो {मुफ़्त करो
A
6 6
B
2 2
C
6. 6>=5: stop. Output: 6.', 0, '2026-05-25', '2026-05-25'), (1, 6, 74, 4, 4, 'What is the output: for(int i=0;i<5;i++) if(i%3==0) cout<<i;', 'Print multiples of 3 in 0-4?', '03', '03', '0', '0', '3', '3', 'Compile error', 'Compile error', NULL, 'option_a', 'i=0: 0%3=0 print; i=3: 3%3=0 print. Output: 03.', 0, '2026-05-25', '2026-05-25'), (1, 6, 74, 4, 4, 'What is the output: int x=10; for(;x>0;x/=2) cout<<x%2;', 'Binary of 10 via loop?', '0101', '0101', '1010', '1010', 'Compile error', 'Compile error', 'Undefined', 'Undefined', NULL, 'option_a', '10%2=0 6. 6>=5: रुकें. आउटपुट: 6.', 0, '2026-05-25', '2026-05-25'), (1, 6, 74, 4, 4, 'आउटपुट क्या है: for(int i=0;i
D
2%2=0 2%2=0
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) 27
व्याख्या (हिन्दी) 27
36
EN + हिं
GB What is the output: for(int i=0;i<10;i+=3) cout<
IN आउटपुट क्या है: for(int i=0;i
A
0369 0369
B
036 036
C
Compile error संकलन त्रुटि
D
Undefined अपरिभाषित
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) 0,3,6,9. Output: 0369.
व्याख्या (हिन्दी) 0,3,6,9. आउटपुट: 0369.
37
EN + हिं
GB What is the output: int x=0; while(x<5) x+=2; cout<
IN आउटपुट क्या है: int x=0; जबकि(x
A
6 6
B
4 4
C
5 5
D
Compile error संकलन त्रुटि
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) 0,2,4,6. 6>=5: stop. Output: 6.
व्याख्या (हिन्दी) 0,2,4,6. 6>=5: रुकें। आउटपुट: 6.
38
EN + हिं
GB What is the output: for(int i=0;i<5;i++) if(i%3==0) cout<
IN आउटपुट क्या है: for(int i=0;i
A
03 03
C
3 3
D
Compile error संकलन त्रुटि
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) i=0: 0%3=0 print; i=3: 3%3=0 print. Output: 03.
व्याख्या (हिन्दी) i=0: 0%3=0 प्रिंट; i=3: 3%3=0 प्रिंट। आउटपुट: 03.
39
EN + हिं
GB What is the output: int x=10; for(;x>0;x/=2) cout<
IN आउटपुट क्या है: int x=10; for(;x>0;x/=2) cout
A
0101 0101
B
1010 1010
C
Compile error संकलन त्रुटि
D
Undefined अपरिभाषित
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) 10%2=0,5%2=1,2%2=0,1%2=1. Output: 0101.
व्याख्या (हिन्दी) 10%2=0,5%2=1,2%2=0,1%2=1. आउटपुट: 0101.
40
EN + हिं
GB What is the output: int n=12; int f=1; for(int i=2;i<=n;i++) f*=i; cout<
IN आउटपुट क्या है: int n=12; int f=1; for(int i=2;i
A
479001600 479001600
C
Undefined अपरिभाषित
D
Compile error संकलन त्रुटि
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) 12!=479001600. Output: 479001600.
व्याख्या (हिन्दी) 12!=479001600. आउटपुट: 479001600.
41
EN + हिं
GB What is the output: for(int i=0;i<3;i++) for(int j=0;j<3;j++) if(i==j) cout<
IN आउटपुट क्या है: for(int i=0;i
A
024 024
B
012 012
C
Compile error संकलन त्रुटि
D
Undefined अपरिभाषित
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) i=j=0:0+0=0; i=j=1:2; i=j=2:4. Output: 024.
व्याख्या (हिन्दी) i=j=0:0+0=0; मैं=जे=1:2; मैं=जे=2:4. आउटपुट: 024.
42
EN + हिं
GB What is the output: int x=1; while(x<1000) x*=3; cout<
IN आउटपुट क्या है: int x=1; जबकि(x
A
2187 2187
B
729 729
C
Compile error संकलन त्रुटि
D
Undefined अपरिभाषित
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) 1,3,9,27,81,243,729,2187. Output: 2187.
व्याख्या (हिन्दी) 1,3,9,27,81,243,729,2187। आउटपुट: 2187.
43
EN + हिं
GB What is 'switch expression' in C++23?
IN C++23 में 'स्विच एक्सप्रेशन' क्या है?
A
Not yet in C++23; only statement form exists अभी तक C++23 में नहीं; केवल कथन प्रपत्र मौजूद है
B
A new C++23 feature एक नई C++23 सुविधा
C
Same as pattern matching पैटर्न मिलान के समान
D
Compile error संकलन त्रुटि
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) C++ has switch statements; switch expressions (like Java) are not in any C++ standard yet.
व्याख्या (हिन्दी) C++ में स्विच स्टेटमेंट हैं; स्विच एक्सप्रेशन (जावा की तरह) अभी तक किसी भी C++ मानक में नहीं हैं।
44
EN + हिं
GB What is the output: int x=0; for(int i=0;i<5;i++) x+=i*2+1; cout<
IN आउटपुट क्या है: int x=0; for(int i=0;i
A
25 25
B
20 20
C
Compile error संकलन त्रुटि
D
Undefined अपरिभाषित
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) i=0:1, i=1:3, i=2:5, i=3:7, i=4:9. Sum=25. Output: 25.
व्याख्या (हिन्दी) मैं=0:1, मैं=1:3, मैं=2:5, मैं=3:7, मैं=4:9। योग=25. आउटपुट: 25.
45
EN + हिं
GB What is the output: int x=8; while(x>0){if(x%3==0){cout<
IN आउटपुट क्या है: int x=8; जबकि(x>0){if(x%3==0){cout
A
A
B
AAAAA एएएएए
C
Compile error संकलन त्रुटि
D
Undefined अपरिभाषित
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) Matches case 5 (via fallthrough from 1-4 which have no body). Prints A. Output: A.
व्याख्या (हिन्दी) केस 5 से मेल खाता है (1-4 से फॉलथ्रू के माध्यम से जिसमें कोई बॉडी नहीं है)। प्रिंट ए. आउटपुट: ए.
31–45 of 133