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
1501
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.
1502
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.
1503
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' के रूप में। आउटपुट: बी.
1504
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.
1505
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.
1506
EN + हिं
GB What is the output: int x=5; cout<<(x,x+1,x+2);
IN आउटपुट क्या है: int x=5; अदालत
A
7 7
B
5 5
C
Compile error संकलन त्रुटि
D
Undefined अपरिभाषित
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) Comma returns rightmost: x+2=7. Output: 7.
व्याख्या (हिन्दी) अल्पविराम सबसे दाहिनी ओर लौटता है: x+2=7. आउटपुट: 7.
1507
EN + हिं
GB What is the output: char s[6]="hello"; cout<
IN आउटपुट क्या है: char s[6]='हैलो'; अदालत
A
5 5
B
6 6
C
Compile error संकलन त्रुटि
D
Undefined अपरिभाषित
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) strlen counts to null: 5. Output: 5.
व्याख्या (हिन्दी) स्ट्रलेन की गिनती शून्य: 5. आउटपुट: 5.
1508
EN + हिं
GB What is the output: int x=100; cout<<(x/=3)<
IN आउटपुट क्या है: int x=100; अदालत
A
3333 3333
B
10033 10033
C
Compile error संकलन त्रुटि
D
Undefined अपरिभाषित
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) x/=3: x=33. C++17 left-to-right: print 33, then print 33. Output: 3333.
व्याख्या (हिन्दी) x/=3: x=33. C++17 बाएँ से दाएँ: 33 प्रिंट करें, फिर 33 प्रिंट करें। आउटपुट: 3333।
1509
EN + हिं
GB What is the output: double x=2.5; int y=x; double z=y; cout<<(x==z);
IN आउटपुट क्या है: डबल x=2.5; int y=x; डबल z=y; अदालत
B
1 1
C
Compile error संकलन त्रुटि
D
Undefined अपरिभाषित
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) y=2 (truncated); z=2.0. 2.5!=2.0. Output: 0.
व्याख्या (हिन्दी) y=2 (छोटा); z=2.0. 2.5!=2.0. आउटपुट: 0.
1510
EN + हिं
GB What is the output: int x=5; cout<<(+x)<<(-x)<<(~x)<<(!x);
IN आउटपुट क्या है: int x=5; अदालत
A
5-5-60 5-5-60
B
5-50 5-50
C
Compile error संकलन त्रुटि
D
Undefined अपरिभाषित
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) +5=5, -5=-5, ~5=-6, !5=0. Output: 5-5-60.
व्याख्या (हिन्दी) +5=5, -5=-5, ~5=-6, !5=0. आउटपुट: 5-5-60.
1511
EN + हिं
GB What is the output: int x=15; cout<
IN आउटपुट क्या है: int x=15; अदालत
A
f 17 15 एफ 17 15
B
F 17 15 एफ 17 15
C
Compile error संकलन त्रुटि
D
Undefined अपरिभाषित
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) hex 15=f (lowercase), oct 15=17, dec=15. Output: f 17 15.
व्याख्या (हिन्दी) हेक्स 15=एफ (लोअरकेस), अक्टूबर 15=17, दिसंबर=15। आउटपुट: एफ 17 15.
1512
EN + हिं
GB What is the output: string s="12345"; int x=stoi(s); cout<
IN आउटपुट क्या है: स्ट्रिंग s='12345'; int x=stoi(s); अदालत
A
24690 24690
B
2468 2468
C
Compile error संकलन त्रुटि
D
Undefined अपरिभाषित
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) stoi("12345")=12345. 12345*2=24690. Output: 24690.
व्याख्या (हिन्दी) स्टोई("12345")=12345. 12345*2=24690. आउटपुट: 24690.
1513
EN + हिं
GB What is the output: int x=5; int* p=nullptr; p=&x; cout<<(p?*p:-1);
IN आउटपुट क्या है: int x=5; int* p=nullptr; पी=&x; अदालत
A
5 5
B
-1 -1
C
Compile error संकलन त्रुटि
D
Undefined अपरिभाषित
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) p=&x (not null); *p=5. Output: 5.
व्याख्या (हिन्दी) p=&x (शून्य नहीं); *पी=5. आउटपुट: 5.
1514
EN + हिं
GB What is the output: auto x=5; auto y=5.0; cout<<(x==y);
IN आउटपुट क्या है: ऑटो x=5; ऑटो y=5.0; अदालत
A
1 1
C
Compile error संकलन त्रुटि
D
Undefined अपरिभाषित
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) x converted to double=5.0; 5.0==5.0=true=1. Output: 1.
व्याख्या (हिन्दी) x को डबल=5.0 में परिवर्तित किया गया; 5.0==5.0=सत्य=1. आउटपुट: 1.
1515
EN + हिं
GB What is the output: int x=5; int y=x++; int z=++x; cout<
IN आउटपुट क्या है: int x=5; int y=x++; int z=++x; अदालत
A
757 757
B
776 776
C
Compile error संकलन त्रुटि
D
Undefined अपरिभाषित
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) y=x++=5(x=6); z=++x=7(x=7). x=7,y=5,z=7. Output: 757.
व्याख्या (हिन्दी) y=x++=5(x=6); z=++x=7(x=7). x=7,y=5,z=7. आउटपुट: 757.
1501–1515 of 1915