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
121
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.
122
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; (एक्स
123
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.
124
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.
125
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.
126
EN + हिं
GB What is the output: int x=5; cout<
IN आउटपुट क्या है: int x=5; अदालत
A
4 4
B
5 5
C
Compile error संकलन त्रुटि
D
Undefined अपरिभाषित
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) min=4. Output: 4.
व्याख्या (हिन्दी) मिनट=4. आउटपुट: 4.
127
EN + हिं
GB What is the output: int x=5; cout<<(x%10)<<(x/10);
IN आउटपुट क्या है: int x=5; अदालत
A
50 50
B
05 05
C
Compile error संकलन त्रुटि
D
Undefined अपरिभाषित
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) 5%10=5; 5/10=0. Output: 50.
व्याख्या (हिन्दी) 5%10=5; 5/10=0. आउटपुट: 50.
128
EN + हिं
GB What is the output: int x=5; cout<
IN आउटपुट क्या है: int x=5; अदालत
A
10 10
B
15 15
D
Compile error संकलन त्रुटि
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) x*3=15; clamp(15,0,10)=10. Output: 10.
व्याख्या (हिन्दी) x*3=15; क्लैंप(15,0,10)=10. आउटपुट: 10.
129
EN + हिं
GB What is the output: int x=5; cout<<(x&0)==0;
IN आउटपुट क्या है: int x=5; अदालत
A
1 1
C
Compile error संकलन त्रुटि
D
Undefined अपरिभाषित
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) x&0=0; 0==0=1. Output: 1.
व्याख्या (हिन्दी) x&0=0; 0==0=1. आउटपुट: 1.
130
EN + हिं
GB What is the output: int x=5; cout<<(x|0x80000000u);
IN आउटपुट क्या है: int x=5; अदालत
A
2147483653 2147483653
B
-2147483643 -2147483643
C
Compile error संकलन त्रुटि
D
Undefined अपरिभाषित
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) 0x80000000 as int is INT_MIN. 5|INT_MIN= negative. As signed: -2147483643. Output: -2147483643.
व्याख्या (हिन्दी) 0x80000000 int के रूप में INT_MIN है। 5|INT_MIN= negative. As signed: -2147483643. Output: -2147483643.
131
EN + हिं
GB What is the output: int x=5; cout<<(bool)(x&(x+1));
IN आउटपुट क्या है: int x=5; अदालत
A
1 1
C
Compile error संकलन त्रुटि
D
Undefined अपरिभाषित
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) 5=101; 6=110; 101&110=100=4!=0=true=1. Output: 1.
व्याख्या (हिन्दी) 5=101; 6=110; 101&110=100=4!=0=सत्य=1. आउटपुट: 1.
132
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
133
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.
134
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.
135
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.
121–135 of 163