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
151
EN + हिं
GB What is the output: int x=5; cout<<(x^(x^0));
IN आउटपुट क्या है: int x=5; अदालत
A
5 5
C
Compile error संकलन त्रुटि
D
Undefined अपरिभाषित
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) x^0=x; x^x=0... wait: x^(x^0)=x^x=0. Hmm. x^0=x; then x^x=0. Output: 0.
व्याख्या (हिन्दी) x^0=x; x^x=0... प्रतीक्षा करें: x^(x^0)=x^x=0. हम्म। x^0=x; फिर x^x=0. आउटपुट: 0.
152
EN + हिं
GB What is the output: int x=5; cout<<(x^0)<<(x^x)<<(x^(~0));
IN आउटपुट क्या है: int x=5; अदालत
A
50-6 50-6
B
50 50
C
Compile error संकलन त्रुटि
D
Undefined अपरिभाषित
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) x^0=5; x^x=0; x^~0=~x=-6. Output: 50-6.
व्याख्या (हिन्दी) x^0=5; x^x=0; x^~0=~x=-6. आउटपुट: 50-6.
153
EN + हिं
GB What is the output: int x=5; cout<<(x&&2)<<(x&2)<<(x||0)<<(x|0);
IN आउटपुट क्या है: int x=5; अदालत
A
1015 1015
B
1 1 0 5 1 1 0 5
C
Compile error संकलन त्रुटि
D
Undefined अपरिभाषित
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) x&&2=1; x&2=0 (101&010=0); x||0=1; x|0=5. Output: 1015.
व्याख्या (हिन्दी) x&&2=1; x&2=0 (101&010=0); x||0=1; x|0=5. आउटपुट: 1015.
154
EN + हिं
GB 'What is the output: int a=5,b=3; int c=a>b?a (1, 6, 73, 3, 4, 'What is the output: int x=5; cout<<(x>>0)<<(x>>1)<<(x>>2)<<(x>>3);', 'Right shift 0
IN 'आउटपुट क्या है: int a=5,b=3; int c=a>b?a (1, 6, 73, 3, 4, 'आउटपुट क्या है: int x=5; cout0)1)2)3);', 'राइट शिफ्ट 0
A
2 2
B
Three ways to double x? x को दोगुना करने के तीन तरीके?
C
10 10 10 10 10 10
D
105 105
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) Undefined
व्याख्या (हिन्दी) अपरिभाषित
155
EN + हिं
GB What is the output: int x=5; cout<<(x>>0)<<(x>>1)<<(x>>2)<<(x>>3);
IN आउटपुट क्या है: int x=5; cout0)1)2)3);
A
5210 5210
B
5321 5321
C
Compile error संकलन त्रुटि
D
Undefined अपरिभाषित
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) 5>>0=5; 5>>1=2; 5>>2=1; 5>>3=0. Output: 5210.
व्याख्या (हिन्दी) 5>>0=5; 5>>1=2; 5>>2=1; 5>>3=0. आउटपुट: 5210.
156
EN + हिं
GB What is the output: cout<<(sizeof(int)*8-1);
IN आउटपुट क्या है: cout
A
31 31
B
32 32
C
Compile error संकलन त्रुटि
D
Undefined अपरिभाषित
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) 4*8-1=31. Output: 31.
व्याख्या (हिन्दी) 4*8-1=31. आउटपुट: 31.
157
EN + हिं
GB What is the output: int x=5; cout<<(x>0)-(x<0)+(x==0);
IN आउटपुट क्या है: int x=5; अदालत
A
1 1
B
2 2
C
Compile error संकलन त्रुटि
D
Undefined अपरिभाषित
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) (1)-(0)+(0)=1. Output: 1.
व्याख्या (हिन्दी) (1)-(0)+(0)=1. आउटपुट: 1.
158
EN + हिं
GB What is the output: int x=10; x=x/2+x%2; cout<
IN आउटपुट क्या है: int x=10; x=x/2+x%2; अदालत
A
5 5
B
6 6
C
Compile error संकलन त्रुटि
D
Undefined अपरिभाषित
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) 10/2+10%2=5+0=5. Output: 5.
व्याख्या (हिन्दी) 10/2+10%2=5+0=5. आउटपुट: 5.
159
EN + हिं
GB What is the output: int x=7; cout<<(x/(x&-x));
IN आउटपुट क्या है: int x=7; अदालत
A
7 7
B
3 3
C
Compile error संकलन त्रुटि
D
Undefined अपरिभाषित
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) 7&-7=1. 7/1=7. Output: 7.
व्याख्या (हिन्दी) 7&-7=1. 7/1=7. आउटपुट: 7.
160
EN + हिं
GB What is the output: int x=5; cout<<(x*2)<<' '<<(x<<1)<<' '<<(x+x);
IN आउटपुट क्या है: int x=5; अदालत
A
10 10 10 10 10 10
B
105 105
C
Compile error संकलन त्रुटि
D
Undefined अपरिभाषित
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) All equal 10. Output: 10 10 10.
व्याख्या (हिन्दी) सभी बराबर 10. आउटपुट: 10 10 10.
161
EN + हिं
GB What is the output: int a=4,b=6; cout<<((a+b)/2)<<' '<<((a+b)>>1);
IN आउटपुट क्या है: int a=4,b=6; अदालत
A
5 5 5 5
B
55 55
C
Compile error संकलन त्रुटि
D
Undefined अपरिभाषित
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) 10/2=5; 10>>1=5. Output: 5 5.
व्याख्या (हिन्दी) 10/2=5; 10>>1=5. आउटपुट: 5 5.
162
EN + हिं
GB What is the output: int x=5; cout<<(-1*x)<<(~x+1);
IN आउटपुट क्या है: int x=5; अदालत
A
-5-5 -5-5
B
5-6 5-6
C
Compile error संकलन त्रुटि
D
Undefined अपरिभाषित
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) -1*5=-5; ~5+1=-5. Output: -5-5.
व्याख्या (हिन्दी) -1*5=-5; ~5+1=-5. आउटपुट: -5-5.
163
EN + हिं
GB What is the output: int x=5; bool odd=x&1,pos=x>0; cout<<(odd&&pos?"odd+": odd?"odd": pos?"pos":"neither");
IN आउटपुट क्या है: int x=5; बूल विषम=x&1,pos=x>0; अदालत
A
odd+ विषम+
B
odd विषम
C
Compile error संकलन त्रुटि
D
Undefined अपरिभाषित
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) x=5: odd=1,pos=1. odd&&pos: "odd+". Output: odd+.
व्याख्या (हिन्दी) x=5: विषम=1, स्थिति=1। विषम&&स्थिति: "विषम+"। आउटपुट: विषम+.
151–163 of 163