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
1456
EN + हिं
GB What is the output: string s="hello"; s.insert(2,"XY"); cout<
IN आउटपुट क्या है: स्ट्रिंग s='हैलो'; s.insert(2,"XY"); अदालत
A
heXYllo heXYllo
B
hXYello hXYello
C
Compile error संकलन त्रुटि
D
Undefined अपरिभाषित
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) Insert at pos 2: he+XY+llo. Output: heXYllo.
व्याख्या (हिन्दी) स्थिति 2 पर डालें: he+XY+llo. आउटपुट: heXYllo.
1457
EN + हिं
GB What is the output: string s="Hello World"; transform(s.begin(),s.end(),s.begin(),::tolower); cout<
IN आउटपुट क्या है: स्ट्रिंग s='हैलो वर्ल्ड'; transform(s.begin(),s.end(),s.begin(),::tolower); अदालत
A
hello world हैलो वर्ल्ड
B
HELLO WORLD हैलो वर्ल्ड
C
Compile error संकलन त्रुटि
D
Undefined अपरिभाषित
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) All chars lowercased. Output: hello world.
व्याख्या (हिन्दी) सभी वर्ण छोटे कर दिये गये। आउटपुट: हेलो वर्ल्ड.
1458
EN + हिं
GB What is the output: stringstream ss; ss<<1<<' '<<2<<' '<<3; int a,b,c; ss>>a>>b>>c; cout<
IN आउटपुट क्या है: स्ट्रिंगस्ट्रीम एसएस; एस एस
A
6 6
B
3 3
C
Compile error संकलन त्रुटि
D
Undefined अपरिभाषित
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) Parse 1,2,3. Sum=6. Output: 6.
व्याख्या (हिन्दी) पार्स 1,2,3. योग=6. आउटपुट: 6.
1459
EN + हिं
GB What is the output: int x=42; string s=to_string(x); cout<
IN आउटपुट क्या है: int x=42; स्ट्रिंग s=to_string(x); अदालत
A
24 24
B
42 42
C
Compile error संकलन त्रुटि
D
Undefined अपरिभाषित
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) "42" has size 2, s[0]='4'. Output: 24.
व्याख्या (हिन्दी) "42" का आकार 2 है, s[0]='4'। आउटपुट: 24.
1460
EN + हिं
GB What is the output: vector v={"a","bb","ccc"}; cout<
IN आउटपुट क्या है: वेक्टर v={"a","bb","ccc"}; अदालत
A
abbccc abbcc
B
accc ए सी सी सी
C
Compile error संकलन त्रुटि
D
Undefined अपरिभाषित
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) "a"+"bb"+"ccc"="abbccc". Output: abbccc.
व्याख्या (हिन्दी) "ए"+"बीबी"+"सीसीसी"='एबीबीसीसीसी''। आउटपुट: एबीबीसीसीसी।
1461
EN + हिं
GB What is the output: auto s=string(5,'x'); cout<
IN आउटपुट क्या है: auto s=string(5,'x'); अदालत
A
xxxxx xxxxx
B
x एक्स
C
Compile error संकलन त्रुटि
D
Undefined अपरिभाषित
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) 5 copies of 'x'. Output: xxxxx.
व्याख्या (हिन्दी) 'x' की 5 प्रतियाँ। आउटपुट: xxxxx.
1462
EN + हिं
GB What is the output: string s="abcdef"; cout<
IN आउटपुट क्या है: स्ट्रिंग s='abcdef'; अदालत
A
cde सीडीई
B
abc एबीसी
C
Compile error संकलन त्रुटि
D
Undefined अपरिभाषित
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) Start=2, length=3: c,d,e. Output: cde.
व्याख्या (हिन्दी) प्रारंभ=2, लंबाई=3: सी,डी,ई। आउटपुट: सीडीई.
1463
EN + हिं
1464
EN + हिं
GB What is the output: cout<
IN आउटपुट क्या है: cout
A
0.143 0.143
B
0.14 0.14
C
Compile error संकलन त्रुटि
D
Undefined अपरिभाषित
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) 1/7≈0.14285... rounded to 3=0.143. Output: 0.143.
व्याख्या (हिन्दी) 1/7≈0.14285... को 3=0.143 तक पूर्णांकित किया गया। आउटपुट: 0.143.
1465
EN + हिं
GB What is the output: int x=5; auto f=[]()->decltype(x){return x*2;}; cout<
IN आउटपुट क्या है: int x=5; ऑटो f=[]()->decltype(x){रिटर्न x*2;}; अदालत
A
10 10
B
5 5
C
Compile error संकलन त्रुटि
D
Undefined अपरिभाषित
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) f()=x*2=10. Output: 10.
व्याख्या (हिन्दी) f()=x*2=10. आउटपुट: 10.
1466
EN + हिं
GB What is the output: int x=0; auto inc=[&x](int n=1){x+=n;}; inc(); inc(5); cout<
IN आउटपुट क्या है: int x=0; ऑटो इंक=[&x](int n=1){x+=n;}; inc(); इंक(5); अदालत
A
6 6
B
1 1
C
Compile error संकलन त्रुटि
D
Undefined अपरिभाषित
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) x+=1=1; x+=5=6. Output: 6.
व्याख्या (हिन्दी) x+=1=1; x+=5=6. आउटपुट: 6.
1467
EN + हिं
GB What is the output: vector v={1,2,3,4,5}; cout<
IN आउटपुट क्या है: वेक्टर v={1,2,3,4,5}; अदालत
A
5 5
B
6 6
C
Compile error संकलन त्रुटि
D
Undefined अपरिभाषित
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) 1*5=5. Output: 5.
व्याख्या (हिन्दी) 1*5=5. आउटपुट: 5.
1468
EN + हिं
GB What is the output: deque d={1,2,3}; d.push_front(0); d.push_back(4); cout<
IN आउटपुट क्या है: deque d={1,2,3}; d.push_front(0); d.push_back(4); अदालत
A
045 045
B
145 145
C
Compile error संकलन त्रुटि
D
Undefined अपरिभाषित
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) front=0, back=4, size=5. Output: 045.
व्याख्या (हिन्दी) आगे=0, पीछे=4, आकार=5. आउटपुट: 045.
1469
EN + हिं
GB What is the output: map m; m["a"]=1; m["b"]=2; m["c"]=3; cout<
IN आउटपुट क्या है: मानचित्र एम; एम["ए"]=1; एम["बी"]=2; एम["सी"]=3; अदालत
A
23 23
B
32 32
C
Compile error संकलन त्रुटि
D
Undefined अपरिभाषित
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) m["b"]=2, size=3. Output: 23.
व्याख्या (हिन्दी) m["b"]=2, size=3. आउटपुट: 23.
1470
EN + हिं
GB What is the output: set s={3,1,4,1,5,9,2,6}; cout<
IN आउटपुट क्या है: सेट s={3,1,4,1,5,9,2,6}; अदालत
A
71 71
B
81 81
C
Compile error संकलन त्रुटि
D
Undefined अपरिभाषित
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) Unique: {1,2,3,4,5,6,9}=7. First=1. Output: 71.
व्याख्या (हिन्दी) अद्वितीय: {1,2,3,4,5,6,9}=7. प्रथम=1. आउटपुट: 71.
1456–1470 of 1915