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
76
EN + हिं
GB What is the output: for(int i=0;i<3;i++) {for(int j=0;j<3;j++) {if(j==2) continue; cout<
IN आउटपुट क्या है: for(int i=0;i
A
01 34 67 01 34 67
B
013467 013467
C
Compile error संकलन त्रुटि
D
Undefined अपरिभाषित
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) i=0:j=0:0,j=1:1,j=2:skip; i=1:3,4,skip; i=2:6,7,skip. Output: 013467.
व्याख्या (हिन्दी) i=0:j=0:0,j=1:1,j=2:छोड़ें; मैं=1:3,4,छोड़ें; मैं=2:6,7,छोड़ें। आउटपुट: 013467.
77
EN + हिं
GB What is the output: int n=5; int a[5]={0}; for(int i=0;i
IN आउटपुट क्या है: int n=5; int a[5]={0}; for(int i=0;i
A
15 15
B
5 5
C
Compile error संकलन त्रुटि
D
Undefined अपरिभाषित
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) 1+2+3+4+5=15. Output: 15.
व्याख्या (हिन्दी) 1+2+3+4+5=15. आउटपुट: 15.
78
EN + हिं
GB What is the output: int x=5,y=0; while(x>0){y=y*10+x%10;x/=10;} cout<
IN आउटपुट क्या है: int x=5,y=0; while(x>0){y=y*10+x%10;x/=10;} cout
A
5 5
C
Compile error संकलन त्रुटि
D
Undefined अपरिभाषित
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) Single digit 5: reversed=5. Output: 5.
व्याख्या (हिन्दी) एकल अंक 5: उलटा=5. आउटपुट: 5.
79
EN + हिं
GB What is the output: int x=123,y=0; while(x>0){y=y*10+x%10;x/=10;} cout<
IN आउटपुट क्या है: int x=123,y=0; while(x>0){y=y*10+x%10;x/=10;} cout
A
321 321
B
123 123
C
Compile error संकलन त्रुटि
D
Undefined अपरिभाषित
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) 3,2,1 -> y=3,32,321. Output: 321.
व्याख्या (हिन्दी) 3,2,1 -> y=3,32,321. आउटपुट: 321.
80
EN + हिं
GB What is the output: for(int i=0;i<5;i++) {if(i%2==0)continue; if(i>3)break; cout<
IN आउटपुट क्या है: for(int i=0;i3)break; अदालत
A
13 13
B
135 135
C
Compile error संकलन त्रुटि
D
Undefined अपरिभाषित
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) i=1:print;i=3:print;i=4 even skip; i=4... wait: i=4 even,continue;i=5>5 stop. Hmm: i=0:even,skip;i=1:odd,1>3 false:print 1;i=2:even,skip;i=3:odd,3>3 false:print 3;i=4:even,skip;i=5:loop ends. Output: 13.
व्याख्या (हिन्दी) i=1:print;i=3:print;i=4 यहां तक ​​कि छोड़ें; i=4... रुकें: i=4 सम,जारी रखें;i=5>5 रुकें। हम्म: i=0:सम,छोड़ें;i=1:विषम,1>3 असत्य:प्रिंट 1;i=2:सम,छोड़ें;i=3:विषम,3>3 असत्य:प्रिंट 3;i=4:सम,छोड़ें;i=5:लूप समाप्त होता है। आउटपुट: 13.
81
EN + हिं
GB What is the output: int x=5; switch(x){case 5: cout<
IN आउटपुट क्या है: int x=5; स्विच(x){केस 5: कॉउट
A
50 50
B
5 5
C
Compile error संकलन त्रुटि
D
Undefined अपरिभाषित
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) case 5: print 5, x=0, fallthrough; case 0: print 0, break. Output: 50.
व्याख्या (हिन्दी) केस 5: प्रिंट 5, x=0, फॉलथ्रू; केस 0: प्रिंट 0, ब्रेक। आउटपुट: 50.
82
EN + हिं
GB What is the output: for(int i=0;i<3;i++) {for(int j=0;j<3;j++) {cout<
IN आउटपुट क्या है: for(int i=0;i
A
0 0 0 1 0 0 0 1
B
Compile error संकलन त्रुटि
C
Undefined अपरिभाषित
D
0 0 0 0
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) i=0:0 0 0;i=1:0 1 then i==j==1: goto done. Output: 0 0 0 0 1.
व्याख्या (हिन्दी) i=0:0 0 0;i=1:0 1 फिर i==j==1: हो गया। आउटपुट: 0 0 0 0 1.
83
EN + हिं
GB What is the output: for(int i=0;i<5;i++) cout<<(i&1?i*i:0);
IN आउटपुट क्या है: for(int i=0;i
A
01094 01094
B
0 1 0 9 0 0 1 0 9 0
C
Compile error संकलन त्रुटि
D
Undefined अपरिभाषित
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) i=0:0,i=1:1,i=2:0,i=3:9,i=4:0. Output: 01090.
व्याख्या (हिन्दी) i=0:0,i=1:1,i=2:0,i=3:9,i=4:0. आउटपुट: 01090.
84
EN + हिं
GB What is the output: int a=1,b=2; if(a>0&&(b=5)>0) cout<
IN आउटपुट क्या है: int a=1,b=2; if(a>0&&(b=5)>0) cout
A
5 5
B
2 2
C
Compile error संकलन त्रुटि
D
Undefined अपरिभाषित
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) a>0=true; evaluate (b=5)>0=true; b=5. Output: 5.
व्याख्या (हिन्दी) a>0=सत्य; मूल्यांकन करें (b=5)>0=सत्य; बी=5. आउटपुट: 5.
85
EN + हिं
GB What is the output: for(int i=2;i<10;i++) if(i%2==0&&i%3==0&&i%5==0) cout<
IN आउटपुट क्या है: for(int i=2;i
A
Nothing कुछ नहीं
B
6 6
C
30 30
D
Compile error संकलन त्रुटि
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) LCM(2,3,5)=30>10. No such i. Output: (nothing).
व्याख्या (हिन्दी) एलसीएम(2,3,5)=30>10. ऐसा कोई नहीं I आउटपुट: (कुछ नहीं)।
86
EN + हिं
GB 'What is the output: int x=5; if(x>0){x (1, 6, 74, 4, 4, 'What is the output: int n=0; for(int i=1;i*i<=25;i++) n++; cout<
IN 'आउटपुट क्या है: int x=5; यदि(x>0){x (1, 6, 74, 4, 4, 'आउटपुट क्या है: int n=0; for(int i=1;i*i
A
3 3
B
5: 1 5:1
C
9 9
D
25<=25. i=6: 36>25. n=5. Output: 5.', 0, '2026-05-25', '2026-05-25'), (1, 6, 74, 4, 4, 'What is the output: for(int i=0;i<3;i++) {int j=0; while(j<3) {cout<<i+j; j+=2;}}', 'i+j where j=0 2525. एन=5. आउटपुट: 5.', 0, '2026-05-25', '2026-05-25'), (1, 6, 74, 4, 4, 'आउटपुट क्या है: for(int i=0;i
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) j=2:2+2=4. Output: 021324.', 'See explanation.', 0, '2026-05-25', '2026-05-25'), (1, 6, 74, 4, 4, 'What is the output: int x=1; switch(x){default: cout<<\'D\'; case 1: cout<<\'A\'; break; case 2: cout<<\'B\';}'
व्याख्या (हिन्दी) जे=2:2+2=4. आउटपुट: 021324.', 'स्पष्टीकरण देखें।', 0, '2026-05-25', '2026-05-25'), (1, 6, 74, 4, 4, 'आउटपुट क्या है: int x=1; स्विच(x){डिफ़ॉल्ट: cout
87
EN + हिं
GB What is the output: int n=0; for(int i=1;i*i<=25;i++) n++; cout<
IN आउटपुट क्या है: int n=0; for(int i=1;i*i
A
5 5
B
6 6
C
Compile error संकलन त्रुटि
D
Undefined अपरिभाषित
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) i=1,2,3,4,5: 1,4,9,16,25<=25. i=6: 36>25. n=5. Output: 5.
व्याख्या (हिन्दी) मैं=1,2,3,4,5: 1,4,9,16,2525। एन=5. आउटपुट: 5.
88
EN + हिं
GB What is the output: for(int i=0;i<3;i++) {int j=0; while(j<3) {cout<
IN आउटपुट क्या है: for(int i=0;i
A
0 2 1 3 2 4 0 2 1 3 2 4
B
036 036
C
Compile error संकलन त्रुटि
D
Undefined अपरिभाषित
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) See explanation.
व्याख्या (हिन्दी) स्पष्टीकरण देखें.
89
EN + हिं
GB What is the output: int x=1; switch(x){default: cout<<'D'; case 1: cout<<'A'; break; case 2: cout<<'B';}
IN आउटपुट क्या है: int x=1; स्विच(x){डिफ़ॉल्ट: कॉउट
A
DA डीए
B
A
C
D डी
D
Compile error संकलन त्रुटि
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) x=1 matches case 1 (cases checked in order but match is by value): A then break. Output: A.
व्याख्या (हिन्दी) x=1 केस 1 से मेल खाता है (मामलों को क्रम में जांचा गया है लेकिन मिलान मूल्य के अनुसार है): ए फिर ब्रेक। आउटपुट: ए.
90
EN + हिं
GB What is the output: for(int i=1;i<10;i++) if(i%2==0) if(i%3==0) cout<
IN आउटपुट क्या है: for(int i=1;i
A
6 6
B
2 2
C
Compile error संकलन त्रुटि
D
Undefined अपरिभाषित
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) 6: even and div by 3. Output: 6.
व्याख्या (हिन्दी) 6: सम और विभाजन 3 से। आउटपुट: 6।
76–90 of 133