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
106
EN + हिं
GB What is the output: int x=1; for(int i=0;i<5;i++) x*=(i+1); cout<
IN आउटपुट क्या है: int x=1; for(int i=0;i
A
120 120
B
15 15
C
Compile error संकलन त्रुटि
D
Undefined अपरिभाषित
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) 5!=120. Output: 120.
व्याख्या (हिन्दी) 5!=120. आउटपुट: 120.
107
EN + हिं
GB What is the output: int x=0; for(int i=0;i<5;i++) if(i%3) x+=i; cout<
IN आउटपुट क्या है: int x=0; for(int i=0;i
A
1 2 4 1 2 4
B
7 7
C
Compile error संकलन त्रुटि
D
Undefined अपरिभाषित
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) i=1:1,i=2:2,i=4:4. Sum=1+2+4=7. Output: 7.
व्याख्या (हिन्दी) मैं=1:1,मैं=2:2,मैं=4:4. योग=1+2+4=7. आउटपुट: 7.
108
EN + हिं
GB What is the output: for(int i=1;i<=10;i++) if(i%2==0&&i%3==0) cout<
IN आउटपुट क्या है: for(int i=1;i
A
6 6
B
Compile error संकलन त्रुटि
C
Undefined अपरिभाषित
D
Nothing कुछ नहीं
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) Only 6. Output: 6.
व्याख्या (हिन्दी) केवल 6. आउटपुट: 6.
109
EN + हिं
GB What is the output: int x=1; while(x<1024) x<<=1; cout<
IN आउटपुट क्या है: int x=1; जबकि(x
A
1024 1024
B
512 512
C
Compile error संकलन त्रुटि
D
Undefined अपरिभाषित
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) 512<1024: x=1024. Output: 1024.
व्याख्या (हिन्दी) 512
110
EN + हिं
GB What is the output: int x=100; while(x>1){if(x%2==0)x/=2;else x=x*3+1;} cout<
IN आउटपुट क्या है: int x=100; while(x>1){if(x%2==0)x/=2;else x=x*3+1;} cout
A
1 1
C
Compile error संकलन त्रुटि
D
Undefined अपरिभाषित
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) Collatz from 100 reaches 1. Output: 1.
व्याख्या (हिन्दी) 100 से Collatz 1 तक पहुंचता है। आउटपुट: 1।
111
EN + हिं
GB What is the output: int s=0; for(int i=1;i<=10;i++) s+=(i%2==0?i:-i); cout<
IN आउटपुट क्या है: int s=0; for(int i=1;i
A
-5 -5
B
5 5
C
Compile error संकलन त्रुटि
D
Undefined अपरिभाषित
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) (-1+2-3+4-5+6-7+8-9+10)=-5. Output: -5.
व्याख्या (हिन्दी) (-1+2-3+4-5+6-7+8-9+10)=-5. आउटपुट:-5.
112
EN + हिं
GB What is the output: for(int i=0;i<5;i++) {int t=i*i; if(t>10) break; cout<
IN आउटपुट क्या है: for(int i=0;i10) breaking; अदालत
A
01491 01491
B
014 014
C
Compile error संकलन त्रुटि
D
Undefined अपरिभाषित
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) 0,1,4,9(break). Wait: 3^2=9<=10:print; 4^2=16>10:break. Output: 01491... 0,1,4,9. Output: 0149.
व्याख्या (हिन्दी) 0,1,4,9(ब्रेक)। रुको: 3^2=910:ब्रेक। आउटपुट: 01491... 0,1,4,9। आउटपुट: 0149.
113
EN + हिं
GB What is the output: int n=7,r=1; for(int i=2;i<=n;i+=2) r*=i; cout<
IN आउटपुट क्या है: int n=7,r=1; for(int i=2;i
A
48 48
B
24 24
C
Compile error संकलन त्रुटि
D
Undefined अपरिभाषित
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) 2*4*6=48. Output: 48.
व्याख्या (हिन्दी) 2*4*6=48. आउटपुट: 48.
114
EN + हिं
GB What is the output: int x=10; do{x/=2;}while(x>2); cout<
IN आउटपुट क्या है: int x=10; do{x/=2;}जबकि(x>2); अदालत
A
2 2
B
1 1
C
Compile error संकलन त्रुटि
D
Undefined अपरिभाषित
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) 10->5->2 (2>2 false). Output: 2.
व्याख्या (हिन्दी) 10->5->2 (2>2 असत्य)। आउटपुट: 2.
115
EN + हिं
GB What is the output: int cnt=0; for(int i=1;i<=50;i++) if(i%3==0||i%7==0) cnt++; cout<
IN आउटपुट क्या है: int cnt=0; for(int i=1;i
A
22 22
B
20 20
C
Compile error संकलन त्रुटि
D
Undefined अपरिभाषित
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) Multiples of 3: 16; multiples of 7: 7; multiples of 21: 2. 16+7-2=21. Output: 21.
व्याख्या (हिन्दी) 3 के गुणज: 16; 7:7 के गुणज; 21 के गुणज: 2. 16+7-2=21. आउटपुट: 21.
116
EN + हिं
GB What is the output: string s=""; for(char c='a';c<='e';c++) s+=c; cout<
IN आउटपुट क्या है: स्ट्रिंग s='''; for(char c='a';c
A
abcde एबीसीडीई
B
ae
C
Compile error संकलन त्रुटि
D
Undefined अपरिभाषित
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) Appends a,b,c,d,e. Output: abcde.
व्याख्या (हिन्दी) ए, बी, सी, डी, ई जोड़ता है। आउटपुट: एबीसीडीई.
117
EN + हिं
GB What is the output: int x=5; switch(x){case 5: cout<<'A'; [[fallthrough]]; case 6: cout<<'B'; break; default: cout<<'C';}
IN आउटपुट क्या है: int x=5; स्विच(x){केस 5: कॉउट
A
AB अब
B
A
C
Compile error संकलन त्रुटि
D
Undefined अपरिभाषित
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) Matches 5, fallthrough to 6: AB. Output: AB.
व्याख्या (हिन्दी) मैच 5, फ़ॉलथ्रू 6: एबी। आउटपुट: एबी.
118
EN + हिं
GB What is the output: for(int i=1;i<=5;i++) for(int j=i;j<=5;j++) if(i*j>12) {cout<
IN आउटपुट क्या है: for(int i=1;i
A
34 34
B
43 43
C
Compile error संकलन त्रुटि
D
Undefined अपरिभाषित
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) i=1:j goes 1-5: max=5; i=2:max=10; i=3:j=3:9,j=4:12,j=5:15>12: print 35. Hmm: 3*5=15>12. Output: 35.
व्याख्या (हिन्दी) i=1:j 1-5 हो जाता है: अधिकतम=5; मैं=2:अधिकतम=10; i=3:j=3:9,j=4:12,j=5:15>12: प्रिंट 35। हम्म: 3*5=15>12। आउटपुट: 35.
119
EN + हिं
GB What is the output: for(int i=2;i<10;i++) if(i%2!=0&&i%3!=0) cout<
IN आउटपुट क्या है: for(int i=2;i
A
57 57
B
13 13
C
Compile error संकलन त्रुटि
D
Undefined अपरिभाषित
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) 5 and 7. Output: 57.
व्याख्या (हिन्दी) 5 और 7. आउटपुट: 57.
120
EN + हिं
GB What is the output: int x=1; for(int i=0;i<5;i++) x+=x; cout<
IN आउटपुट क्या है: int x=1; for(int i=0;i
A
32 32
B
16 16
C
Compile error संकलन त्रुटि
D
Undefined अपरिभाषित
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) 1,2,4,8,16,32. Output: 32.
व्याख्या (हिन्दी) 1,2,4,8,16,32. आउटपुट: 32.
106–120 of 133