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
61
EN + हिं
GB What is the output: int x=5; int y=++x>5?1:0; cout<
IN आउटपुट क्या है: int x=5; int y=++x>5?1:0; अदालत
A
16 16
B
06 06
C
Compile error संकलन त्रुटि
D
Undefined अपरिभाषित
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) ++x=6>5=true; y=1. x=6. Output: 16.
व्याख्या (हिन्दी) ++x=6>5=सत्य; आप=1. एक्स=6. आउटपुट: 16.
62
EN + हिं
GB What is the output: cout<<(int)(2.9)<<(int)(2.1)<<(int)(-2.9);
IN आउटपुट क्या है: cout
A
22-2 22-2
B
33-3 33-3
C
Compile error संकलन त्रुटि
D
Undefined अपरिभाषित
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) Truncate toward zero: 2,2,-2. Output: 22-2.
व्याख्या (हिन्दी) शून्य की ओर काटें: 2,2,-2. आउटपुट: 22-2.
63
EN + हिं
GB What is the output: int x=1; cout<<(x<<1)<<(x<<2)<<(x<<3);
IN आउटपुट क्या है: int x=1; अदालत
A
248 248
B
124 124
C
Compile error संकलन त्रुटि
D
Undefined अपरिभाषित
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) 1<<1=2, 1<<2=4, 1<<3=8. Output: 248.
व्याख्या (हिन्दी) 1
64
EN + हिं
GB What is the output: int x=5,y=3; cout<<(x>y)-(x
IN आउटपुट क्या है: int x=5,y=3; अदालत
A
1 1
B
2 2
D
Compile error संकलन त्रुटि
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) (x>y)=1,(x
व्याख्या (हिन्दी) (x>y)=1,(x
65
EN + हिं
GB What is the output: int x=5; cout<<(x&-1);
IN आउटपुट क्या है: int x=5; अदालत
A
5 5
C
-1 -1
D
Compile error संकलन त्रुटि
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) -1 all bits set; x&(-1)=x=5. Output: 5.
व्याख्या (हिन्दी) -1 सभी बिट्स सेट; x&(-1)=x=5. आउटपुट: 5.
66
EN + हिं
GB What is the output: int x=5; cout<<(x|-1);
IN आउटपुट क्या है: int x=5; अदालत
A
-1 -1
B
5 5
D
Compile error संकलन त्रुटि
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) x|-1: any value OR all-bits-set = -1. Output: -1.
व्याख्या (हिन्दी) x|-1: कोई भी मान या सभी-बिट्स-सेट = -1। आउटपुट:-1.
67
EN + हिं
GB What is the output: int x=5; cout<<(x^-1);
IN आउटपुट क्या है: int x=5; अदालत
A
-6 -6
B
5 5
C
Compile error संकलन त्रुटि
D
Undefined अपरिभाषित
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) x^(-1): XOR with all-bits-set = bitwise NOT = ~5 = -6. Output: -6.
व्याख्या (हिन्दी) x^(-1): ऑल-बिट्स-सेट के साथ XOR = बिटवाइज़ NOT = ~5 = -6। आउटपुट: -6.
68
EN + हिं
GB What is the output: int x=0; cout<<(x||x++);
IN आउटपुट क्या है: int x=0; अदालत
A
1 1
C
Undefined अपरिभाषित
D
Compile error संकलन त्रुटि
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) x=0 falsy; x++ evaluated: returns 0 falsy, x=1. 0||0=0. Output: 0.
व्याख्या (हिन्दी) x=0 मिथ्या; x++ का मूल्यांकन किया गया: 0 मिथ्या लौटाता है, x=1। 0||0=0. आउटपुट: 0.
69
EN + हिं
GB What is the output: int x=5; cout<<((x%2)+2)%2;
IN आउटपुट क्या है: int x=5; अदालत
A
1 1
C
Compile error संकलन त्रुटि
D
Undefined अपरिभाषित
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) 5%2=1. (1+2)%2=3%2=1. Output: 1.
व्याख्या (हिन्दी) 5%2=1. (1+2)%2=3%2=1. आउटपुट: 1.
70
EN + हिं
GB What is the output: int x=100; cout<<(x/10/10);
IN आउटपुट क्या है: int x=100; अदालत
A
1 1
B
10 10
C
100 100
D
Compile error संकलन त्रुटि
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) 100/10=10, 10/10=1. Output: 1.
व्याख्या (हिन्दी) 100/10=10, 10/10=1. आउटपुट: 1.
71
EN + हिं
GB What is the output: int x=5; int y=x++; cout<
IN आउटपुट क्या है: int x=5; int y=x++; अदालत
A
1 1
C
Undefined अपरिभाषित
D
Compile error संकलन त्रुटि
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) y=5 (post-increment), x=6. x-y=1. Output: 1.
व्याख्या (हिन्दी) y=5 (वृद्धि के बाद), x=6. x-y=1. आउटपुट: 1.
72
EN + हिं
GB What is the output: int x=5; int y=++x; cout<
IN आउटपुट क्या है: int x=5; int y=++x; अदालत
B
1 1
C
Undefined अपरिभाषित
D
Compile error संकलन त्रुटि
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) ++x=6=y. x-y=0. Output: 0.
व्याख्या (हिन्दी) ++x=6=y. x-y=0. आउटपुट: 0.
73
EN + हिं
GB What is the output: int a=2,b=3; cout<<(a<
IN आउटपुट क्या है: int a=2,b=3; अदालत
A
4 4
B
12 12
C
-4 -4
D
Compile error संकलन त्रुटि
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) 2<<3=16, 3<<2=12. 16-12=4. Output: 4.
व्याख्या (हिन्दी) 2
74
EN + हिं
GB What is the output: int x=7; cout<<(x&0x55);
IN आउटपुट क्या है: int x=7; अदालत
A
5 5
B
7 7
D
Compile error संकलन त्रुटि
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) 0b00000111 & 0b01010101 = 0b00000101 = 5. Output: 5.
व्याख्या (हिन्दी) 0b00000111 और 0b01010101 = 0b00000101 = 5. आउटपुट: 5.
75
EN + हिं
GB What is the output: int x=0; cout<<(++x,++x,++x);
IN आउटपुट क्या है: int x=0; अदालत
A
3 3
B
1 1
C
Undefined अपरिभाषित
D
Compile error संकलन त्रुटि
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) Comma: ++x=1, ++x=2, ++x=3. Returns 3. Output: 3.
व्याख्या (हिन्दी) अल्पविराम: ++x=1, ++x=2, ++x=3. रिटर्न 3. आउटपुट: 3.
61–75 of 163