OOP Using C++ — MCQ Practice

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

📚 163 Questions 🌐 Hindi + English ✅ Free
भाषा / Language:
163 questions
76
EN + हिं
GB What is the output: int x=5; cout<<(x>0?(x>10?'H':'M'):'L');
IN आउटपुट क्या है: int x=5; cout10?'H':'M'):'L');
A
M एम
B
H एच
C
L एल
D
Compile error संकलन त्रुटि
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) x>0=true; x>10=false; returns 'M'. Output: M.
व्याख्या (हिन्दी) x>0=सत्य; x>10=गलत; 'एम' लौटाता है। आउटपुट: एम.
77
EN + हिं
GB What is the output: int a=1,b=0; cout<<(a|b)<<(a&b)<<(a^b);
IN आउटपुट क्या है: int a=1,b=0; अदालत
A
101 101
B
010 010
C
100 100
D
Compile error संकलन त्रुटि
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) 1|0=1, 1&0=0, 1^0=1. Output: 101.
व्याख्या (हिन्दी) 1|0=1, 1&0=0, 1^0=1. आउटपुट: 101.
78
EN + हिं
GB What is the output: int x=255; cout<<(x&0xAA)<<' '<<(x&0x55);
IN आउटपुट क्या है: int x=255; अदालत
A
170 85 170 85
B
85 170 85 170
C
Compile error संकलन त्रुटि
D
Undefined अपरिभाषित
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) 0xAA=10101010=170; 0x55=01010101=85. Output: 170 85.
व्याख्या (हिन्दी) 0xAA=10101010=170; 0x55=01010101=85. आउटपुट: 170 85.
79
EN + हिं
GB What is the output: int x=5; cout<<((x&4)?1:0)<<((x&2)?1:0)<<((x&1)?1:0);
IN आउटपुट क्या है: int x=5; अदालत
A
101 101
B
010 010
C
Compile error संकलन त्रुटि
D
Undefined अपरिभाषित
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) 5&4=4(truthy)=1; 5&2=0=0; 5&1=1=1. Output: 101.
व्याख्या (हिन्दी) 5&4=4(सत्य)=1; 5&2=0=0; 5&1=1=1. आउटपुट: 101.
80
EN + हिं
GB What is the output: int x=5; cout<<(x>0&&cout<<'Y');
IN आउटपुट क्या है: int x=5; अदालत
A
Y1 Y1
B
1Y 1 वर्ष
C
Compile error संकलन त्रुटि
D
Undefined अपरिभाषित
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) x>0=true; right side: cout<<'Y' prints Y and returns cout (truthy). cout<<1 prints 1. Total: Y1.
व्याख्या (हिन्दी) x>0=सत्य; दाईं ओर: कॉउट
81
EN + हिं
GB What is the output: int x=5; x^=3; x^=3; cout<
IN आउटपुट क्या है: int x=5; x^=3; x^=3; अदालत
A
5 5
B
6 6
D
Compile error संकलन त्रुटि
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) x^3=6, 6^3=5. Back to original. Output: 5.
व्याख्या (हिन्दी) x^3=6, 6^3=5. मूल पर वापस जाएँ। आउटपुट: 5.
82
EN + हिं
GB What is the output: int x=2; cout<<(x<
IN आउटपुट क्या है: int x=2; अदालत
A
8 8
B
4 4
C
2 2
D
Compile error संकलन त्रुटि
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) 2<<2=8. Output: 8.
व्याख्या (हिन्दी) 2
83
EN + हिं
GB What is the output: int x=5; auto y=(x,x+1,x+2); cout<
IN आउटपुट क्या है: int x=5; ऑटो y=(x,x+1,x+2); अदालत
A
7 7
B
5 5
C
6 6
D
Compile error संकलन त्रुटि
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) (x, x+1, x+2) = 7. Output: 7.
व्याख्या (हिन्दी) (एक्स, एक्स+1, एक्स+2) = 7. आउटपुट: 7.
84
EN + हिं
GB What is the output: int x=1; for(int i=0;i<4;i++) cout<<(x<<=1);
IN आउटपुट क्या है: int x=1; for(int i=0;i
A
2 2
B
2481 2481
C
Compile error संकलन त्रुटि
D
Undefined अपरिभाषित
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) x: 2,4,8,16. But x<<= each time from previous. i=0:x=2; i=1:x=4; i=2:x=8; i=3:x=16. Output: 2481... wait 16. Output: 2 4 8 16 concatenated: 24816.
व्याख्या (हिन्दी) एक्स: 2,4,8,16. लेकिन एक्स
85
EN + हिं
GB What is the output: int x=5,y=5; cout<<(x==y?'E':'N');
IN आउटपुट क्या है: int x=5,y=5; अदालत
A
E
B
N एन
C
Compile error संकलन त्रुटि
D
Undefined अपरिभाषित
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) 5==5=true; 'E'. Output: E.
व्याख्या (हिन्दी) 5==5=सत्य; 'ई'. आउटपुट: ई.
86
EN + हिं
GB What is the output: int x=5; cout<<(x?x-1:x+1);
IN आउटपुट क्या है: int x=5; अदालत
A
4 4
B
6 6
C
Compile error संकलन त्रुटि
D
Undefined अपरिभाषित
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) x=5 truthy; x-1=4. Output: 4.
व्याख्या (हिन्दी) x=5 सत्य; x-1=4. आउटपुट: 4.
87
EN + हिं
GB What is the output: int x=4; cout<<(x&3)<<(x|3)<<(x^3);
IN आउटपुट क्या है: int x=4; अदालत
A
077 077
B
473 473
C
Compile error संकलन त्रुटि
D
Undefined अपरिभाषित
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) 4&3=0, 4|3=7, 4^3=7. Output: 077.
व्याख्या (हिन्दी) 4&3=0, 4|3=7, 4^3=7। आउटपुट: 077.
88
EN + हिं
GB What is the output: int x=5; cout<<(x<=5&&x>=5);
IN आउटपुट क्या है: int x=5; अदालत
A
1 1
C
Compile error संकलन त्रुटि
D
Undefined अपरिभाषित
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) Both true. 1&&1=1. Output: 1.
व्याख्या (हिन्दी) दोनों सच. 1&&1=1. आउटपुट: 1.
89
EN + हिं
GB What is the output: int x=7; cout<<(x&0xF0)>>4;
IN आउटपुट क्या है: int x=7; cout4;
B
7 7
C
Compile error संकलन त्रुटि
D
Undefined अपरिभाषित
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) 7=0000 0111. 7&0xF0=0. 0>>4=0. Output: 0.
व्याख्या (हिन्दी) 7=0000 0111. 7&0xF0=0. 0>>4=0. आउटपुट: 0.
90
EN + हिं
GB What is the output: int a=5,b=3; cout<<(a>b)-(a
IN आउटपुट क्या है: int a=5,b=3; अदालत
A
1 1
C
-1 -1
D
Compile error संकलन त्रुटि
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) 5>3=1, 5<3=0. 1-0=1. Output: 1.
व्याख्या (हिन्दी) 5>3=1, 5
76–90 of 163