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
1486
EN + हिं
GB What is the output: int x=5,y=10; auto [a,b]=make_pair(x,y); a=99; cout<
IN आउटपुट क्या है: int x=5,y=10; ऑटो [ए,बी]=मेक_पेयर(एक्स,वाई); ए=99; अदालत
A
510 510
B
9910 9910
C
Compile error संकलन त्रुटि
D
Undefined अपरिभाषित
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) a is copy; a=99 doesn't affect x. b=10. Output: 510.
व्याख्या (हिन्दी) ए प्रतिलिपि है; a=99 x को प्रभावित नहीं करता. बी=10. आउटपुट: 510.
1487
EN + हिं
GB What is the output: int x=5; int& r=x; auto y=r; y=99; cout<
IN आउटपुट क्या है: int x=5; int& r=x; ऑटो y=r; y=99; अदालत
A
5 5
B
99 99
C
Compile error संकलन त्रुटि
D
Undefined अपरिभाषित
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) auto y=r: strips reference, y is int copy. y=99 doesn't affect x. Output: 5.
व्याख्या (हिन्दी) ऑटो y=r: स्ट्रिप्स संदर्भ, y इंट कॉपी है। y=99 x को प्रभावित नहीं करता. आउटपुट: 5.
1488
EN + हिं
GB What is the output: char c='A'; int x=c; cout<
IN आउटपुट क्या है: char c='A'; int x=c; अदालत
A
65 65
B
A
C
Compile error संकलन त्रुटि
D
Undefined अपरिभाषित
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) 'A'=65. Output: 65.
व्याख्या (हिन्दी) 'ए'=65. आउटपुट: 65.
1489
EN + हिं
GB What is the output: bool b=false; int x=b+b+b; cout<
IN आउटपुट क्या है: bool b=false; int x=b+b+b; अदालत
B
3 3
C
Compile error संकलन त्रुटि
D
Undefined अपरिभाषित
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) 0+0+0=0. Output: 0.
व्याख्या (हिन्दी) 0+0+0=0. आउटपुट: 0.
1490
EN + हिं
GB What is the output: int x=INT_MAX-1; x+=2; cout<
IN आउटपुट क्या है: int x=INT_MAX-1; एक्स+=2; अदालत
A
Undefined behavior अपरिभाषित व्यवहार
B
INT_MIN+1 INT_MIN+1
C
Compile error संकलन त्रुटि
D
1 1
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) INT_MAX-1+2 = INT_MAX+1: signed overflow = UB.
व्याख्या (हिन्दी) INT_MAX-1+2 = INT_MAX+1: हस्ताक्षरित अतिप्रवाह = यूबी।
1491
EN + हिं
GB What is the output: unsigned x=1; cout<<(x-2);
IN आउटपुट क्या है: unsigned x=1; अदालत
A
4294967295 4294967295
B
-1 -1
C
Undefined अपरिभाषित
D
Compile error संकलन त्रुटि
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) 1-2 unsigned wraps to UINT_MAX=4294967295. Output: 4294967295.
व्याख्या (हिन्दी) UINT_MAX=4294967295 पर 1-2 अहस्ताक्षरित रैप्स। आउटपुट: 4294967295.
1492
EN + हिं
GB What is the output: int x=5; auto* p=&x; auto q=p; cout<<*q;
IN आउटपुट क्या है: int x=5; ऑटो* पी=&x; ऑटो क्यू=पी; अदालत
A
5 5
B
Compile error संकलन त्रुटि
C
Undefined अपरिभाषित
D
Address पता
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) q is int* copy of p. *q=x=5. Output: 5.
व्याख्या (हिन्दी) q int* p की प्रतिलिपि है। *q=x=5. आउटपुट: 5.
1493
EN + हिं
GB What is the output: int x=5; const int& r=x+1; cout<
IN आउटपुट क्या है: int x=5; const int& r=x+1; अदालत
A
6 6
B
5 5
C
Compile error संकलन त्रुटि
D
Undefined अपरिभाषित
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) x+1=6; const ref extends lifetime. r=6. Output: 6.
व्याख्या (हिन्दी) x+1=6; स्थिरांक रेफरी जीवनकाल बढ़ाता है। आर=6. आउटपुट: 6.
1494
EN + हिं
GB What is the output: int x=42; void* p=&x; cout<<*static_cast(p);
IN आउटपुट क्या है: int x=42; शून्य* पी=&x; अदालत
A
42 42
C
Compile error संकलन त्रुटि
D
Undefined अपरिभाषित
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) static_cast back to int*; *=42. Output: 42.
व्याख्या (हिन्दी) static_cast वापस int* पर; *=42. आउटपुट: 42.
1495
EN + हिं
GB What is the output: double d=1.23456789; cout<
IN आउटपुट क्या है: डबल d=1.23456789; अदालत
A
1.2346 1.2346
B
1.2345 1.2345
C
Compile error संकलन त्रुटि
D
Undefined अपरिभाषित
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) Rounds 1.23456789 to 4 places: 1.2346. Output: 1.2346.
व्याख्या (हिन्दी) राउंड 1.23456789 से 4 स्थानों तक: 1.2346। आउटपुट: 1.2346.
1496
EN + हिं
GB What is the output: float f=1.0f/3.0f; cout<<(f==1.0f/3.0f);
IN आउटपुट क्या है: फ्लोट f=1.0f/3.0f; अदालत
A
1 1
C
Compile error संकलन त्रुटि
D
Undefined अपरिभाषित
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) Same computation gives same float. Output: 1.
व्याख्या (हिन्दी) समान गणना समान फ़्लोट देती है. आउटपुट: 1.
1497
EN + हिं
GB What is the output: int x=5; cout<
IN आउटपुट क्या है: int x=5; अदालत
A
d डी
B
i मैं
C
Compile error संकलन त्रुटि
D
Undefined अपरिभाषित
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) int+double promotes to double. typeid=double='d'. Output: d.
व्याख्या (हिन्दी) int+double दोगुना करने को बढ़ावा देता है। टाइपआईडी=डबल='डी'। आउटपुट: डी.
1498
EN + हिं
GB What is the output: int a=5,b=3; cout<
IN आउटपुट क्या है: int a=5,b=3; अदालत
A
531 531
B
351 351
C
Compile error संकलन त्रुटि
D
Undefined अपरिभाषित
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) max=5, min=3, 5/3=1. Output: 531.
व्याख्या (हिन्दी) अधिकतम=5, न्यूनतम=3, 5/3=1. आउटपुट: 531.
1499
EN + हिं
GB What is the output: int x=10; int y=x; x=20; cout<
IN आउटपुट क्या है: int x=10; int y=x; एक्स=20; अदालत
A
10 10
B
20 20
C
Compile error संकलन त्रुटि
D
Undefined अपरिभाषित
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) y is copy of original x=10. x changes don't affect y. Output: 10.
व्याख्या (हिन्दी) y मूल x=10 की प्रतिलिपि है। x परिवर्तन y को प्रभावित नहीं करते. आउटपुट: 10.
1500
EN + हिं
GB What is the output: auto x=1+2u; cout<
IN आउटपुट क्या है: ऑटो x=1+2u; अदालत
A
4 4
B
8 8
C
Compile error संकलन त्रुटि
D
Undefined अपरिभाषित
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) 1+2u: int promoted to unsigned. unsigned=4 bytes. Output: 4.
व्याख्या (हिन्दी) 1+2u: int को अहस्ताक्षरित में पदोन्नत किया गया। अहस्ताक्षरित=4 बाइट्स. आउटपुट: 4.
1486–1500 of 1915