OOP Using C++ — MCQ Practice

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

📚 160 Questions 🌐 Hindi + English ✅ Free
भाषा / Language:
160 questions
136
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.
137
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.
138
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.
139
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.
140
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.
141
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.
142
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 दोगुना करने को बढ़ावा देता है। टाइपआईडी=डबल='डी'। आउटपुट: डी.
143
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.
144
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.
145
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.
146
EN + हिं
GB What is the output: enum E{A=1,B=2,C=4}; cout<<(A|B|C);
IN आउटपुट क्या है: enum E{A=1,B=2,C=4}; अदालत
A
7 7
B
3 3
C
Compile error संकलन त्रुटि
D
Undefined अपरिभाषित
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) 1|2|4=7. Output: 7.
व्याख्या (हिन्दी) 1|2|4=7. आउटपुट: 7.
147
EN + हिं
GB What is the output: int x=5; cout<
IN आउटपुट क्या है: int x=5; अदालत
A
1 1
B
4 4
C
Compile error संकलन त्रुटि
D
Undefined अपरिभाषित
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) x==5 is bool; sizeof(bool)=1. Output: 1.
व्याख्या (हिन्दी) x==5 बूल है; आकार(बूल)=1. आउटपुट: 1.
148
EN + हिं
GB What is the output: wchar_t w=L'A'; cout<<(wchar_t)(w+1);
IN आउटपुट क्या है: wchar_t w=L'A'; अदालत
A
B बी
B
A
C
Compile error संकलन त्रुटि
D
Undefined अपरिभाषित
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) L'A'+1=L'B'; output as wchar_t='B'. Output: B.
व्याख्या (हिन्दी) एल'ए'+1=एल'बी'; आउटपुट wchar_t='B' के रूप में। आउटपुट: बी.
149
EN + हिं
GB What is the output: int x=0; cout<<(x++==0)<<(x++==1)<<(x++==2);
IN आउटपुट क्या है: int x=0; अदालत
A
111 111
B
000 000
C
Compile error संकलन त्रुटि
D
Undefined अपरिभाषित
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) x++=0==0=1,x=1; x++=1==1=1,x=2; x++=2==2=1,x=3. Output: 111.
व्याख्या (हिन्दी) x++=0==0=1,x=1; x++=1==1=1,x=2; x++=2==2=1,x=3. आउटपुट: 111.
150
EN + हिं
GB What is the output: long double ld=1.0L/3.0L; cout<<(ld>1.0/3.0);
IN आउटपुट क्या है: लंबा डबल ld=1.0L/3.0L; अदालत
A
1 1
C
Compile error संकलन त्रुटि
D
Undefined अपरिभाषित
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) long double has more precision; may differ from double. Result is implementation-defined but typically 1. Output: 1.
व्याख्या (हिन्दी) लंबे डबल में अधिक सटीकता होती है; डबल से भिन्न हो सकता है. परिणाम कार्यान्वयन-परिभाषित है लेकिन आम तौर पर 1. आउटपुट: 1.
136–150 of 160