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
1516
EN + हिं
GB What is the output: int x=5,y=3; cout<<(x>y)<<(x=y)<<(x<=y)<<(x==y)<<(x!=y);
IN आउटपुट क्या है: int x=5,y=3; अदालत
A
100111 100111
B
101001 101001
C
Compile error संकलन त्रुटि
D
Undefined अपरिभाषित
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) 5>3=1,5<3=0,5>=3=1,5<=3=0,5==3=0,5!=3=1. Output: 101001.
व्याख्या (हिन्दी) 5>3=1,5=3=1,5
1517
EN + हिं
GB What is the output: int x=5; x=x>3?x+1:x-1; x=x>5?x*2:x+3; cout<
IN आउटपुट क्या है: int x=5; x=x>3?x+1:x-1; x=x>5?x*2:x+3; अदालत
A
9 9
B
12 12
C
Compile error संकलन त्रुटि
D
Undefined अपरिभाषित
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) x=6 (x=5>3:6); x=6>5:12. Output: 12.
व्याख्या (हिन्दी) x=6 (x=5>3:6); x=6>5:12. आउटपुट: 12.
1518
EN + हिं
GB What is the output: int a=10,b=3; cout<<(a/b*b+a%b);
IN आउटपुट क्या है: int a=10,b=3; अदालत
A
10 10
B
9 9
C
Compile error संकलन त्रुटि
D
Undefined अपरिभाषित
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) 3*3+1=10=a. Output: 10.
व्याख्या (हिन्दी) 3*3+1=10=ए. आउटपुट: 10.
1519
EN + हिं
GB What is the output: int x=5; cout<<(x<<2)+(x>>2);
IN आउटपुट क्या है: int x=5; अदालत
A
21 21
B
25 25
C
Compile error संकलन त्रुटि
D
Undefined अपरिभाषित
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) 20+1=21. Output: 21.
व्याख्या (हिन्दी) 20+1=21. आउटपुट: 21.
1520
EN + हिं
GB What is the output: int x=0b11111111; cout<<(x&0x55)+(x&0xAA);
IN आउटपुट क्या है: int x=0b11111111; अदालत
A
255 255
B
128 128
C
Compile error संकलन त्रुटि
D
Undefined अपरिभाषित
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) 0x55=85, 0xAA=170. x&0x55=85, x&0xAA=170. 85+170=255. Output: 255.
व्याख्या (हिन्दी) 0x55=85, 0xAA=170. x&0x55=85, x&0xAA=170. 85+170=255. आउटपुट: 255.
1521
EN + हिं
GB What is the output: int x=5; cout<<(x*x+2*x+1);
IN आउटपुट क्या है: int x=5; अदालत
A
36 36
B
25 25
C
Compile error संकलन त्रुटि
D
Undefined अपरिभाषित
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) 6^2=36. Output: 36.
व्याख्या (हिन्दी) 6^2=36. आउटपुट: 36.
1522
EN + हिं
GB What is the output: int x=5; cout<<(x-1)*(x+1)<<' '<
IN आउटपुट क्या है: int x=5; अदालत
A
24 24 24 24
B
24 25 24 25
C
Compile error संकलन त्रुटि
D
Undefined अपरिभाषित
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) 4*6=24; 25-1=24. Output: 24 24.
व्याख्या (हिन्दी) 4*6=24; 25-1=24. आउटपुट: 24 24.
1523
EN + हिं
GB What is the output: bool a=1>0, b=2>3; cout<<(a&&b)<<(a||b)<<(a^b);
IN आउटपुट क्या है: bool a=1>0, b=2>3; अदालत
A
011 011
B
101 101
C
Compile error संकलन त्रुटि
D
Undefined अपरिभाषित
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) a=1,b=0. &&=0, ||=1, ^=1. Output: 011.
व्याख्या (हिन्दी) ए=1,बी=0. &&=0, ||=1, ^=1. आउटपुट: 011.
1524
EN + हिं
GB What is the output: int x=7; cout<<(x&0x1)<<(x&0x2)<<(x&0x4);
IN आउटपुट क्या है: int x=7; अदालत
A
124 124
B
142 142
C
Compile error संकलन त्रुटि
D
Undefined अपरिभाषित
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) 7&1=1; 7&2=2; 7&4=4. Output: 124.
व्याख्या (हिन्दी) 7&1=1; 7&2=2; 7&4=4. आउटपुट: 124.
1525
EN + हिं
GB What is the output: int x=5; cout<<((x%2==0)?"even":"odd")<
IN आउटपुट क्या है: int x=5; अदालत
A
odd5 अजीब5
B
even5 सम5
C
Compile error संकलन त्रुटि
D
Undefined अपरिभाषित
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) 5%2!=0: odd. Output: odd5.
व्याख्या (हिन्दी) 5%2!=0: विषम। आउटपुट: विषम5.
1526
EN + हिं
GB What is the output: int x=10; x+=x; x-=5; x*=2; cout<
IN आउटपुट क्या है: int x=10; x+=x; एक्स-=5; एक्स*=2; अदालत
A
30 30
B
25 25
C
Compile error संकलन त्रुटि
D
Undefined अपरिभाषित
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) x=10; x+=10=20; x-=5=15; x*=2=30. Output: 30.
व्याख्या (हिन्दी) एक्स=10; x+=10=20; x-=5=15; x*=2=30. Output: 30.
1527
EN + हिं
GB What is the output: int x=5; int y=(x>0)+(x>1)+(x>2)+(x>3)+(x>4)+(x>5);
IN आउटपुट क्या है: int x=5; int y=(x>0)+(x>1)+(x>2)+(x>3)+(x>4)+(x>5);
A
5 5
B
6 6
C
Compile error संकलन त्रुटि
D
Undefined अपरिभाषित
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) 5>0,1,2,3,4=1 each; 5>5=0. Sum=5. Output: 5.
व्याख्या (हिन्दी) 5>0,1,2,3,4=1 प्रत्येक; 5>5=0. योग=5. आउटपुट: 5.
1528
EN + हिं
GB What is the output: int a=3,b=4; cout<<(a*a+b*b)<<' '<<(a+b)*(a+b);
IN आउटपुट क्या है: int a=3,b=4; अदालत
A
25 49 25 49
B
49 25 49 25
C
Compile error संकलन त्रुटि
D
Undefined अपरिभाषित
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) 9+16=25; 7^2=49. Output: 25 49.
व्याख्या (हिन्दी) 9+16=25; 7^2=49. आउटपुट: 25 49.
1529
EN + हिं
GB What is the output: cout<<(1<<0|1<<1|1<<2|1<<3);
IN आउटपुट क्या है: cout
A
15 15
B
8 8
C
Compile error संकलन त्रुटि
D
Undefined अपरिभाषित
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) 1|2|4|8=15. Output: 15.
व्याख्या (हिन्दी) 1|2|4|8=15. आउटपुट: 15.
1530
EN + हिं
GB What is the output: int x=255; cout<<(x&0xF)<<((x>>4)&0xF);
IN आउटपुट क्या है: int x=255; अदालत
A
1515 1515
B
0F0F 0एफ0एफ
C
Compile error संकलन त्रुटि
D
Undefined अपरिभाषित
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) 0xFF&0xF=15; 0xF>>4&0xF=15. Output: 1515.
व्याख्या (हिन्दी) 0xFF&0xF=15; 0xF>>4&0xF=15. आउटपुट: 1515.
1516–1530 of 1915