OOP Using C++ — MCQ Practice

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

📚 1915 Questions 🌐 Hindi + English ✅ Free
भाषा / Language:
1915 questions
1201
EN + हिं
GB What is the output: int x=5; cout<<(x*x+x+1)%7;
IN आउटपुट क्या है: int x=5; अदालत
A
3 3
B
31 31
C
Compile error संकलन त्रुटि
D
Undefined अपरिभाषित
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) 31%7=3. Output: 3.
व्याख्या (हिन्दी) 31%7=3. आउटपुट: 3.
1202
EN + हिं
GB What is the output: int x=0; cout<<(x (1, 6, 73, 3, 4, 'What is the output: int x=16; while(x&(x-1)) x&=x-1; cout<
IN आउटपुट क्या है: int x=0; अदालत
A
2026-05-25 2026-05-25
✅ Correct Answer:
1203
EN + हिं
GB What is the output: int x=16; while(x&(x-1)) x&=x-1; cout<
IN आउटपुट क्या है: int x=16; जबकि(x&(x-1)) x&=x-1; अदालत
A
16 16
B
8 8
C
1 1
D
Compile error संकलन त्रुटि
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) 16=10000; 16&15=0: already power of 2. Loop doesn't run. Output: 16.
व्याख्या (हिन्दी) 16=10000; 16&15=0: पहले से ही 2 की शक्ति। लूप नहीं चलता। आउटपुट: 16.
1204
EN + हिं
GB What is the output: int x=5; cout<<(x+(x>>31));
IN आउटपुट क्या है: int x=5; cout31));
A
5 5
C
Compile error संकलन त्रुटि
D
Undefined अपरिभाषित
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) x>>31 for positive x=0 (sign extension). x+0=5. Output: 5.
व्याख्या (हिन्दी) x>>31 सकारात्मक x=0 के लिए (चिह्न विस्तार)। x+0=5. आउटपुट: 5.
1205
EN + हिं
GB What is the output: int x=5; cout<<((x>>31)^x)-((x>>31));
IN आउटपुट क्या है: int x=5; cout31)^x)-((x>>31));
A
5 5
B
-5 -5
C
Compile error संकलन त्रुटि
D
Undefined अपरिभाषित
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) For positive: mask=0. (0^5)-0=5. Output: 5.
व्याख्या (हिन्दी) सकारात्मक के लिए: मुखौटा=0. (0^5)-0=5. आउटपुट: 5.
1206
EN + हिं
GB What is the output: int x=5,y=3; cout<<(x^y^y);
IN आउटपुट क्या है: int x=5,y=3; अदालत
A
5 5
B
3 3
C
Compile error संकलन त्रुटि
D
Undefined अपरिभाषित
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) y^y=0; x^0=x=5. Output: 5.
व्याख्या (हिन्दी) y^y=0; x^0=x=5. आउटपुट: 5.
1207
EN + हिं
GB What is the output: int x=5; cout<<(x!=0?1:0)<<(x>0?1:-1);
IN आउटपुट क्या है: int x=5; अदालत
A
11 11
B
1-1 1-1
C
Compile error संकलन त्रुटि
D
Undefined अपरिभाषित
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) x!=0=1; x>0=1. Output: 11.
व्याख्या (हिन्दी) एक्स!=0=1; x>0=1. आउटपुट: 11.
1208
EN + हिं
GB What is the output: int a=4,b=7; cout<<(a|b)-(a&b);
IN आउटपुट क्या है: int a=4,b=7; अदालत
A
3 3
B
7 7
C
Compile error संकलन त्रुटि
D
Undefined अपरिभाषित
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) a|b=7, a&b=4. 7-4=3. a^b=4^7=011=3. Output: 3.
व्याख्या (हिन्दी) ए|बी=7, ए&बी=4. 7-4=3. a^b=4^7=011=3. आउटपुट: 3.
1209
EN + हिं
GB What is the output: int x=5; cout<<(x+0)<<(x*1)<<(x-0)<<(x/1);
IN आउटपुट क्या है: int x=5; अदालत
A
5555 5555
B
0155 0155
C
Compile error संकलन त्रुटि
D
Undefined अपरिभाषित
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) 5+0=5, 5*1=5, 5-0=5, 5/1=5. Output: 5555.
व्याख्या (हिन्दी) 5+0=5, 5*1=5, 5-0=5, 5/1=5। आउटपुट: 5555.
1210
EN + हिं
GB What is the output: unsigned x=5; cout<<(-x);
IN आउटपुट क्या है: unsigned x=5; अदालत
A
4294967291 4294967291
B
-5 -5
C
Compile error संकलन त्रुटि
D
Undefined अपरिभाषित
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) -(unsigned)5=UINT_MAX-5+1=4294967291. Output: 4294967291.
व्याख्या (हिन्दी) -(अहस्ताक्षरित)5=UINT_MAX-5+1=4294967291. आउटपुट: 4294967291.
1211
EN + हिं
GB What is the output: int x=5; cout<<+(+x)<<-(-x);
IN आउटपुट क्या है: int x=5; अदालत
A
55 55
B
-55 -55
C
Compile error संकलन त्रुटि
D
Undefined अपरिभाषित
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) +(+5)=5; -(-5)=5. Output: 55.
व्याख्या (हिन्दी) +(+5)=5; -(-5)=5. आउटपुट: 55.
1212
EN + हिं
GB What is the output: int x=5; cout<<(x>0&x<10);
IN आउटपुट क्या है: int x=5; अदालत
A
1 1
C
Compile error संकलन त्रुटि
D
Undefined अपरिभाषित
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) (x>0)=1; (x<10)=1; 1&1=1. Output: 1.
व्याख्या (हिन्दी) (x>0)=1; (एक्स
1213
EN + हिं
GB What is the output: int x=5; cout<<(x>0|x>10);
IN आउटपुट क्या है: int x=5; cout10);
A
1 1
C
Compile error संकलन त्रुटि
D
Undefined अपरिभाषित
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) 1|0=1. Output: 1.
व्याख्या (हिन्दी) 1|0=1. आउटपुट: 1.
1214
EN + हिं
GB What is the output: int x=5; auto op=[](int a,int b,int c){return a?b:c;}; cout<3,x*2,x/2);
IN आउटपुट क्या है: int x=5; ऑटो ऑप=[](int a,int b,int c){return a?b:c;}; अदालत
A
10 10
B
2 2
C
Compile error संकलन त्रुटि
D
Undefined अपरिभाषित
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) x>3=1(true); returns b=x*2=10. Output: 10.
व्याख्या (हिन्दी) x>3=1(सत्य); b=x*2=10 लौटाता है। आउटपुट: 10.
1215
EN + हिं
GB What is the output: int x=5; cout<
IN आउटपुट क्या है: int x=5; अदालत
A
10 10
B
8 8
C
Compile error संकलन त्रुटि
D
Undefined अपरिभाषित
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) max=10. Output: 10.
व्याख्या (हिन्दी) अधिकतम=10. आउटपुट: 10.
1201–1215 of 1915