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

Question 91

EN + हिं
GB What is the output: int x=0; for(int i=0;i<5;i++) x=x>i?x:i; cout<
IN आउटपुट क्या है: int x=0; for(int i=0;ii?x:i; cout
4 4
Compile error संकलन त्रुटि
Undefined अपरिभाषित
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) x tracks max: 0,1,2,3,4. Final x=4. Output: 4.
व्याख्या (हिन्दी) x ट्रैक अधिकतम: 0,1,2,3,4. अंतिम x=4. आउटपुट: 4.
🎯 Exam Perspective
OOP Using C++ ("Control Statements" sub-topic) से जुड़ा यह सवाल उन students के लिए काम का है जो SSC, Railway, Banking और State PCS की तैयारी कर रहे हैं। बेहतर होगा कि explanation पढ़कर concept clear करें, ताकि exam में similar प्रश्न आने पर confusion न हो।

Question 92

EN + हिं
GB What is the output: int x=5; while(x>0) {cout<>=1;}
IN आउटपुट क्या है: int x=5; जबकि(x>0) {cout=1;}
5 2 1 5 2 1
531 531
Compile error संकलन त्रुटि
Undefined अपरिभाषित
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) 5,5>>1=2,2>>1=1,1>>1=0. Prints 5,2,1. Output: 521.
व्याख्या (हिन्दी) 5,5>>1=2,2>>1=1,1>>1=0. प्रिंट 5,2,1. आउटपुट: 521.
🎯 Exam Perspective
SSC CGL, IBPS, RRB और State-level परीक्षाओं जैसी परीक्षाओं में OOP Using C++ ("Control Statements" sub-topic) से सवाल अक्सर पूछे जाते हैं। इसलिए सिर्फ answer रटने के बजाय, नीचे दी गई explanation को ध्यान से पढ़ें और concept समझें।

Question 93

EN + हिं
GB What is the output: for(int i=0,s=0;i<5;s+=i,i++) cout<
IN आउटपुट क्या है: for(int i=0,s=0;i
0 1 3 6 10 0 1 3 6 10
01 3610 01 3610
Compile error संकलन त्रुटि
Undefined अपरिभाषित
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) s starts 0; each iteration: print s first, then s+=i,i++. i=0:print 0,s=0; i=1:print 0,s=1;... wait: for init: i=0,s=0; cond i<5; body: cout<
व्याख्या (हिन्दी) s प्रारंभ 0; प्रत्येक पुनरावृत्ति: पहले s प्रिंट करें, फिर s+=i,i++। i=0:प्रिंट 0,s=0; i=1:प्रिंट 0,s=1;... प्रतीक्षा करें: init के लिए: i=0,s=0; शर्त मैं
🎯 Exam Perspective
अगर आप UPSC, SSC, Banking और Police भर्ती की तैयारी कर रहे हैं, तो OOP Using C++ ("Control Statements" sub-topic) का यह topic आपके लिए महत्वपूर्ण है। Exam में accuracy बढ़ाने के लिए हर सवाल की explanation जरूर पढ़ें।

Question 94

EN + हिं
GB What is the output: int x=2; do{x*=x;}while(x<1000); cout<
IN आउटपुट क्या है: int x=2; करो{x*=x;}जबकि(x
65536 65536
256 256
Compile error संकलन त्रुटि
Undefined अपरिभाषित
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) 2->4->16->256->65536. 256<1000: continue. 65536>=1000: stop. Output: 65536.
व्याख्या (हिन्दी) 2->4->16->256->65536. 256=1000: रुकें। आउटपुट: 65536.
🎯 Exam Perspective
OOP Using C++ ("Control Statements" sub-topic) के इस प्रश्न को कई प्रतियोगी परीक्षाओं जैसे Railway, SSC, Banking और Defence परीक्षाओं में repeat होते देखा गया है। Concept clarity के लिए explanation section जरूर पढ़ें।

Question 95

EN + हिं
GB What is the output: for(int i=0;i<5;i++) {if(i==2) {i+=2; continue;} cout<
IN आउटपुट क्या है: for(int i=0;i
01 01
014 014
Compile error संकलन त्रुटि
Undefined अपरिभाषित
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) i=0:print 0;i=1:print 1;i=2:i=4,continue;i=5:loop ends. Wait: i=2,i+=2=4,continue;then increment i++=5,condition 5<5 false. Output: 014. Let me recheck: i=2:i+=2=4;continue: skip cout;then for-increment:i++=5. 5<5 false. Output: 01.
व्याख्या (हिन्दी) i=0:प्रिंट 0;i=1:प्रिंट 1;i=2:i=4,जारी रखें;i=5:लूप समाप्त होता है। प्रतीक्षा करें: i=2,i+=2=4, जारी रखें; फिर वृद्धि i++=5, शर्त 5
🎯 Exam Perspective
यह सवाल OOP Using C++ ("Control Statements" sub-topic) category का है, और SSC, Railway, Banking और State PCS के exam pattern में इस तरह के questions common हैं। Answer choose करने के बाद दिया गया explanation जरूर पढ़ें।

Question 96

EN + हिं
GB What is the output: for(int i=0;i<3;i++) for(int j=0;j<3;j++) if(i==1&&j==1) {cout<
IN आउटपुट क्या है: for(int i=0;i
1 1
Compile error संकलन त्रुटि
Undefined अपरिभाषित
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) i=1,j=1: i*j=1, print 1, goto exit. Output: 1.
व्याख्या (हिन्दी) i=1,j=1: i*j=1, प्रिंट 1, बाहर निकलें। आउटपुट: 1.
🎯 Exam Perspective
यह प्रश्न OOP Using C++ ("Control Statements" sub-topic) की तैयारी करने वाले अभ्यर्थियों के लिए उपयोगी है। इस तरह के प्रश्न अक्सर SSC CGL, IBPS, RRB और State-level परीक्षाओं जैसी परीक्षाओं में पूछे जाते रहे हैं, इसलिए concept और explanation दोनों को ध्यान से समझें, सिर्फ उत्तर याद न करें।

Question 97

EN + हिं
GB What is the output: int x=0; for(int i=1;i<=5;i++) for(int j=1;j<=5;j++) if(i==j) x++; cout<
IN आउटपुट क्या है: int x=0; for(int i=1;i
5 5
25 25
Compile error संकलन त्रुटि
Undefined अपरिभाषित
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) (1,1),(2,2),(3,3),(4,4),(5,5): 5 pairs. Output: 5.
व्याख्या (हिन्दी) (1,1),(2,2),(3,3),(4,4),(5,5): 5 जोड़े। आउटपुट: 5.
🎯 Exam Perspective
OOP Using C++ ("Control Statements" sub-topic) से जुड़ा यह सवाल उन students के लिए काम का है जो UPSC, SSC, Banking और Police भर्ती की तैयारी कर रहे हैं। बेहतर होगा कि explanation पढ़कर concept clear करें, ताकि exam में similar प्रश्न आने पर confusion न हो।

Question 98

EN + हिं
GB What is the output: for(int i=1;i<=5;i++) cout<<(i%3==1?'A':i%3==2?'B':'C');
IN आउटपुट क्या है: for(int i=1;i
ABCAB एबीसीएबी
ABCBA एबीसीबीए
Compile error संकलन त्रुटि
Undefined अपरिभाषित
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) i=1:1%3=1:A;i=2:2%3=2:B;i=3:0:C;i=4:1:A;i=5:2:B. Output: ABCAB.
व्याख्या (हिन्दी) i=1:1%3=1:A;i=2:2%3=2:B;i=3:0:C;i=4:1:A;i=5:2:B. आउटपुट: एबीसीएबी।
🎯 Exam Perspective
Railway, SSC, Banking और Defence परीक्षाओं जैसी परीक्षाओं में OOP Using C++ ("Control Statements" sub-topic) से सवाल अक्सर पूछे जाते हैं। इसलिए सिर्फ answer रटने के बजाय, नीचे दी गई explanation को ध्यान से पढ़ें और concept समझें।

Question 99

EN + हिं
GB What is the output: int s=0; for(int i=1;i<=10;i+=2) s+=i; cout<
IN आउटपुट क्या है: int s=0; for(int i=1;i
25 25
30 30
Compile error संकलन त्रुटि
Undefined अपरिभाषित
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) 1+3+5+7+9=25. Output: 25.
व्याख्या (हिन्दी) 1+3+5+7+9=25. आउटपुट: 25.
🎯 Exam Perspective
अगर आप SSC, Railway, Banking और State PCS की तैयारी कर रहे हैं, तो OOP Using C++ ("Control Statements" sub-topic) का यह topic आपके लिए महत्वपूर्ण है। Exam में accuracy बढ़ाने के लिए हर सवाल की explanation जरूर पढ़ें।

Question 100

EN + हिं
GB What is the output: if constexpr(2+2==4) cout<<'T'; else cout<<'F';
IN आउटपुट क्या है: यदि constexpr(2+2==4) cout
T टी
F एफ
Compile error संकलन त्रुटि
Undefined अपरिभाषित
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) Compile-time: 2+2=4=true. Output: T.
व्याख्या (हिन्दी) संकलन-समय: 2+2=4=सत्य। आउटपुट: टी.
🎯 Exam Perspective
OOP Using C++ ("Control Statements" sub-topic) के इस प्रश्न को कई प्रतियोगी परीक्षाओं जैसे SSC CGL, IBPS, RRB और State-level परीक्षाओं में repeat होते देखा गया है। Concept clarity के लिए explanation section जरूर पढ़ें।

Question 101

EN + हिं
GB What is the output: int x=10; while(x>0) {x=(x%3==0)?x-3:x-1;} cout<
IN आउटपुट क्या है: int x=10; while(x>0) {x=(x%3==0)?x-3:x-1;} cout
-1 -1
Compile error संकलन त्रुटि
Undefined अपरिभाषित
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) 10->9->6->3->0. Output: 0.
व्याख्या (हिन्दी) 10->9->6->3->0. आउटपुट: 0.
🎯 Exam Perspective
यह सवाल OOP Using C++ ("Control Statements" sub-topic) category का है, और UPSC, SSC, Banking और Police भर्ती के exam pattern में इस तरह के questions common हैं। Answer choose करने के बाद दिया गया explanation जरूर पढ़ें।

Question 102

EN + हिं
GB What is the output: for(int i=0;i<10;i++) if((i%2==0)&&(i%3==0)) cout<
IN आउटपुट क्या है: for(int i=0;i
06 06
Compile error संकलन त्रुटि
Undefined अपरिभाषित
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) 0 and 6. Output: 06.
व्याख्या (हिन्दी) 0 और 6. आउटपुट: 06.
🎯 Exam Perspective
यह प्रश्न OOP Using C++ ("Control Statements" sub-topic) की तैयारी करने वाले अभ्यर्थियों के लिए उपयोगी है। इस तरह के प्रश्न अक्सर Railway, SSC, Banking और Defence परीक्षाओं जैसी परीक्षाओं में पूछे जाते रहे हैं, इसलिए concept और explanation दोनों को ध्यान से समझें, सिर्फ उत्तर याद न करें।

Question 103

EN + हिं
GB What is the output: int x=5; switch(x%3){case 0:cout<<'Z';break; case 1:cout<<'O';break; case 2:cout<<'T';break;}
IN आउटपुट क्या है: int x=5; स्विच(x%3){केस 0:काउट
T टी
O हे
Z जेड
Compile error संकलन त्रुटि
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) 5%3=2: case 2: T. Output: T.
व्याख्या (हिन्दी) 5%3=2: केस 2: टी. आउटपुट: टी.
🎯 Exam Perspective
OOP Using C++ ("Control Statements" sub-topic) से जुड़ा यह सवाल उन students के लिए काम का है जो SSC, Railway, Banking और State PCS की तैयारी कर रहे हैं। बेहतर होगा कि explanation पढ़कर concept clear करें, ताकि exam में similar प्रश्न आने पर confusion न हो।

Question 104

EN + हिं
GB 'What is the output: int n=5,f=1; for(int i=n;i>1;i (1, 6, 74, 4, 4, 'What is the output: for(int i=1;i<=5;i++) if(i==3) continue; else cout<
IN 'आउटपुट क्या है: int n=5,f=1; for(int i=n;i>1;i (1, 6, 74, 4, 4, 'आउटपुट क्या है: for(int i=1;i
i=4:4. Sum=1+2+4=7. Output: 7.', 0, '2026-05-25', '2026-05-25'), (1, 6, 75, 5, 4, 'What is the output: int f(int n){return n<=0?0:n+f(n-2);} cout<<f(5)+f(6);', 'f(5)=5+3+1=9 मैं=4:4. योग=1+2+4=7. आउटपुट: 7.', 0, '2026-05-25', '2026-05-25'), (1, 6, 75, 5, 4, 'आउटपुट क्या है: int f(int n){return n
f(6)=12. 9+12=21. Output: 21.', 0, '2026-05-25', '2026-05-25'), (1, 6, 75, 5, 4, 'What is the output: auto f=[](int x)->int{return x>1?x*f(x-1):1;}; cout<<f(4);', 'Recursive lambda (C++14 way without self)?', 'Compile error', 'Compile error', '24', '24', '4', '4', 'Undefined', 'Undefined', NULL, 'option_a', 'Lambda can\'t call itself by name (f is not captured). Compile error.' एफ(6)=12. 9+12=21. आउटपुट: 21.', 0, '2026-05-25', '2026-05-25'), (1, 6, 75, 5, 4, 'आउटपुट क्या है: auto f=[](int x)->int{return x>1?x*f(x-1):1;}; cout
2026-05-25 2026-05-25
✅ Correct Answer:
🎯 Exam Perspective
SSC CGL, IBPS, RRB और State-level परीक्षाओं जैसी परीक्षाओं में OOP Using C++ ("Control Statements" sub-topic) से सवाल अक्सर पूछे जाते हैं। इसलिए सिर्फ answer रटने के बजाय, नीचे दी गई explanation को ध्यान से पढ़ें और concept समझें।

Question 105

EN + हिं
GB What is the output: for(int i=1;i<=5;i++) if(i==3) continue; else cout<
IN आउटपुट क्या है: for(int i=1;i
1245 1245
12345 12345
Compile error संकलन त्रुटि
Undefined अपरिभाषित
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) i=3: continue (skip else). Others: print. Output: 1245.
व्याख्या (हिन्दी) i=3: जारी रखें (अन्यथा छोड़ें)। Others: print. Output: 1245.
🎯 Exam Perspective
अगर आप UPSC, SSC, Banking और Police भर्ती की तैयारी कर रहे हैं, तो OOP Using C++ ("Control Statements" sub-topic) का यह topic आपके लिए महत्वपूर्ण है। Exam में accuracy बढ़ाने के लिए हर सवाल की explanation जरूर पढ़ें।