OOP Using C++ — MCQ Practice

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

📚 187 Questions 🌐 Hindi + English ✅ Free
भाषा / Language:
187 questions

Question 151

EN + हिं
GB What is 'std::ranges::iota' (C++23)?
IN 'std::ranges::iota' (C++23) क्या है?
Fills range with sequentially incrementing values क्रमिक रूप से बढ़ते मानों के साथ श्रेणी भरता है
Same as std::iota std::iota के समान
A view एक दृश्य
Both A and B ए और बी दोनों
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) ranges::iota is the range version; views::iota creates a lazy iota view.
व्याख्या (हिन्दी) रेंज::आईओटा रेंज संस्करण है; दृश्य::iota एक आलसी iota दृश्य बनाता है।
🎯 Exam Perspective
OOP Using C++ ("Introduction to C++" sub-topic) से जुड़ा यह सवाल उन students के लिए काम का है जो SSC CGL, IBPS, RRB और State-level परीक्षाओं की तैयारी कर रहे हैं। बेहतर होगा कि explanation पढ़कर concept clear करें, ताकि exam में similar प्रश्न आने पर confusion न हो।

Question 152

EN + हिं
GB What is the output: auto v=views::iota(1,6)|views::transform([](int x){return x*x;}); cout<{});
IN आउटपुट क्या है: auto v=views::iota(1,6)|views::transform([](int x){return x*x;}); अदालत
55 55
15 15
Compile error संकलन त्रुटि
Undefined अपरिभाषित
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) 1+4+9+16+25=55. Output: 55.
व्याख्या (हिन्दी) 1+4+9+16+25=55. आउटपुट: 55.
🎯 Exam Perspective
UPSC, SSC, Banking और Police भर्ती जैसी परीक्षाओं में OOP Using C++ ("Introduction to C++" sub-topic) से सवाल अक्सर पूछे जाते हैं। इसलिए सिर्फ answer रटने के बजाय, नीचे दी गई explanation को ध्यान से पढ़ें और concept समझें।

Question 153

EN + हिं
GB What is 'std::ranges::fold_left' (C++23)?
IN 'std::ranges::fold_left' (C++23) क्या है?
Left fold over range with binary operation बाइनरी ऑपरेशन के साथ बाईं ओर की सीमा को मोड़ें
Same as accumulate संचय के समान
A reduce एक कमी
Both A and B ए और बी दोनों
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) ranges::fold_left(range,init,op) is equivalent to std::accumulate but works with ranges.
व्याख्या (हिन्दी) रेंज::फोल्ड_लेफ्ट(रेंज,इनिट,ऑप) std::accumute के बराबर है लेकिन रेंज के साथ काम करता है।
🎯 Exam Perspective
अगर आप Railway, SSC, Banking और Defence परीक्षाओं की तैयारी कर रहे हैं, तो OOP Using C++ ("Introduction to C++" sub-topic) का यह topic आपके लिए महत्वपूर्ण है। Exam में accuracy बढ़ाने के लिए हर सवाल की explanation जरूर पढ़ें।

Question 154

EN + हिं
GB What is the output: int x=5; cout<<(x<<1)-(x>>1);
IN आउटपुट क्या है: int x=5; अदालत
8 8
3 3
12 12
Compile error संकलन त्रुटि
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) 10-2=8. Output: 8.
व्याख्या (हिन्दी) 10-2=8. आउटपुट: 8.
🎯 Exam Perspective
OOP Using C++ ("Introduction to C++" sub-topic) के इस प्रश्न को कई प्रतियोगी परीक्षाओं जैसे Railway, SSC, Banking और Defence परीक्षाओं में repeat होते देखा गया है। Concept clarity के लिए explanation section जरूर पढ़ें।

Question 155

EN + हिं
GB What is the output: auto x=5; auto y=2; cout<<(x/y)<<(x%y);
IN आउटपुट क्या है: ऑटो x=5; ऑटो y=2; अदालत
21 21
25 25
Compile error संकलन त्रुटि
Undefined अपरिभाषित
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) 5/2=2, 5%2=1. Output: 21.
व्याख्या (हिन्दी) 5/2=2, 5%2=1. आउटपुट: 21.
🎯 Exam Perspective
यह सवाल OOP Using C++ ("Introduction to C++" sub-topic) category का है, और SSC, Railway, Banking और State PCS के exam pattern में इस तरह के questions common हैं। Answer choose करने के बाद दिया गया explanation जरूर पढ़ें।

Question 156

EN + हिं
GB What is the output: constexpr int arr[]={1,2,3,4,5}; constexpr int s=arr[0]+arr[4]; cout<
IN आउटपुट क्या है: constexpr int arr[]={1,2,3,4,5}; constexpr int s=arr[0]+arr[4]; अदालत
6 6
5 5
Compile error संकलन त्रुटि
Undefined अपरिभाषित
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) 1+5=6. Output: 6.
व्याख्या (हिन्दी) 1+5=6. आउटपुट: 6.
🎯 Exam Perspective
यह प्रश्न OOP Using C++ ("Introduction to C++" sub-topic) की तैयारी करने वाले अभ्यर्थियों के लिए उपयोगी है। इस तरह के प्रश्न अक्सर SSC CGL, IBPS, RRB और State-level परीक्षाओं जैसी परीक्षाओं में पूछे जाते रहे हैं, इसलिए concept और explanation दोनों को ध्यान से समझें, सिर्फ उत्तर याद न करें।

Question 157

EN + हिं
GB What is the output: int x=0b1010; int y=0b0101; cout<<(x+y);
IN आउटपुट क्या है: int x=0b1010; int y=0b0101; अदालत
15 15
10 10
5 5
Compile error संकलन त्रुटि
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) 10+5=15. Output: 15.
व्याख्या (हिन्दी) 10+5=15. आउटपुट: 15.
🎯 Exam Perspective
OOP Using C++ ("Introduction to C++" sub-topic) से जुड़ा यह सवाल उन students के लिए काम का है जो UPSC, SSC, Banking और Police भर्ती की तैयारी कर रहे हैं। बेहतर होगा कि explanation पढ़कर concept clear करें, ताकि exam में similar प्रश्न आने पर confusion न हो।

Question 158

EN + हिं
GB What is the output: string s="hello"; cout<
IN आउटपुट क्या है: स्ट्रिंग s='हैलो'; अदालत
5ho 5हो
5he 5वह
Compile error संकलन त्रुटि
Undefined अपरिभाषित
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) length=5, s[0]='h', back='o'. Output: 5ho.
व्याख्या (हिन्दी) लंबाई=5, s[0]='h', पीछे='o'। आउटपुट: 5ho.
🎯 Exam Perspective
Railway, SSC, Banking और Defence परीक्षाओं जैसी परीक्षाओं में OOP Using C++ ("Introduction to C++" sub-topic) से सवाल अक्सर पूछे जाते हैं। इसलिए सिर्फ answer रटने के बजाय, नीचे दी गई explanation को ध्यान से पढ़ें और concept समझें।

Question 159

EN + हिं
GB What is 'std::string::npos'?
IN 'std::string::npos' क्या है?
Maximum value of size_t; returned when search fails size_t का अधिकतम मान; खोज विफल होने पर वापस आ गया
A null pointer एक शून्य सूचक
Zero index शून्य सूचकांक
End iterator पुनरावर्तक समाप्त करें
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) npos = string::size_type(-1); find() returns it when pattern not found.
व्याख्या (हिन्दी) npos = स्ट्रिंग::आकार_प्रकार(-1); पैटर्न नहीं मिलने पर ढूंढें() इसे वापस कर देता है।
🎯 Exam Perspective
अगर आप SSC, Railway, Banking और State PCS की तैयारी कर रहे हैं, तो OOP Using C++ ("Introduction to C++" sub-topic) का यह topic आपके लिए महत्वपूर्ण है। Exam में accuracy बढ़ाने के लिए हर सवाल की explanation जरूर पढ़ें।

Question 160

EN + हिं
GB What is the output: string s="hello world"; cout<
IN आउटपुट क्या है: स्ट्रिंग s='हैलो वर्ल्ड'; अदालत
6 6
5 5
Compile error संकलन त्रुटि
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) 'world' starts at index 6. Output: 6.
व्याख्या (हिन्दी) 'दुनिया' सूचकांक 6 से शुरू होती है। आउटपुट: 6।
🎯 Exam Perspective
OOP Using C++ ("Introduction to C++" sub-topic) के इस प्रश्न को कई प्रतियोगी परीक्षाओं जैसे SSC CGL, IBPS, RRB और State-level परीक्षाओं में repeat होते देखा गया है। Concept clarity के लिए explanation section जरूर पढ़ें।

Question 161

EN + हिं
GB What is the output: string s="abcde"; s.erase(1,3); cout<
IN आउटपुट क्या है: स्ट्रिंग s='abcde'; s.मिटाना(1,3); अदालत
ae
bcde बीसीडीई
Compile error संकलन त्रुटि
Undefined अपरिभाषित
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) Remove b,c,d leaving a,e. Output: ae.
व्याख्या (हिन्दी) ए,ई छोड़कर बी,सी,डी हटाएं। आउटपुट: एई.
🎯 Exam Perspective
यह सवाल OOP Using C++ ("Introduction to C++" sub-topic) category का है, और UPSC, SSC, Banking और Police भर्ती के exam pattern में इस तरह के questions common हैं। Answer choose करने के बाद दिया गया explanation जरूर पढ़ें।

Question 162

EN + हिं
GB What is the output: string s="hello"; s.insert(2,"XY"); cout<
IN आउटपुट क्या है: स्ट्रिंग s='हैलो'; s.insert(2,"XY"); अदालत
heXYllo heXYllo
hXYello hXYello
Compile error संकलन त्रुटि
Undefined अपरिभाषित
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) Insert at pos 2: he+XY+llo. Output: heXYllo.
व्याख्या (हिन्दी) स्थिति 2 पर डालें: he+XY+llo. आउटपुट: heXYllo.
🎯 Exam Perspective
यह प्रश्न OOP Using C++ ("Introduction to C++" sub-topic) की तैयारी करने वाले अभ्यर्थियों के लिए उपयोगी है। इस तरह के प्रश्न अक्सर Railway, SSC, Banking और Defence परीक्षाओं जैसी परीक्षाओं में पूछे जाते रहे हैं, इसलिए concept और explanation दोनों को ध्यान से समझें, सिर्फ उत्तर याद न करें।

Question 163

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); अदालत
hello world हैलो वर्ल्ड
HELLO WORLD हैलो वर्ल्ड
Compile error संकलन त्रुटि
Undefined अपरिभाषित
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) All chars lowercased. Output: hello world.
व्याख्या (हिन्दी) सभी वर्ण छोटे कर दिये गये। आउटपुट: हेलो वर्ल्ड.
🎯 Exam Perspective
OOP Using C++ ("Introduction to C++" sub-topic) से जुड़ा यह सवाल उन students के लिए काम का है जो SSC, Railway, Banking और State PCS की तैयारी कर रहे हैं। बेहतर होगा कि explanation पढ़कर concept clear करें, ताकि exam में similar प्रश्न आने पर confusion न हो।

Question 164

EN + हिं
GB What is the output: stringstream ss; ss<<1<<' '<<2<<' '<<3; int a,b,c; ss>>a>>b>>c; cout<
IN आउटपुट क्या है: स्ट्रिंगस्ट्रीम एसएस; एस एस
6 6
3 3
Compile error संकलन त्रुटि
Undefined अपरिभाषित
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) Parse 1,2,3. Sum=6. Output: 6.
व्याख्या (हिन्दी) पार्स 1,2,3. योग=6. आउटपुट: 6.
🎯 Exam Perspective
SSC CGL, IBPS, RRB और State-level परीक्षाओं जैसी परीक्षाओं में OOP Using C++ ("Introduction to C++" sub-topic) से सवाल अक्सर पूछे जाते हैं। इसलिए सिर्फ answer रटने के बजाय, नीचे दी गई explanation को ध्यान से पढ़ें और concept समझें।

Question 165

EN + हिं
GB What is the output: int x=42; string s=to_string(x); cout<
IN आउटपुट क्या है: int x=42; स्ट्रिंग s=to_string(x); अदालत
24 24
42 42
Compile error संकलन त्रुटि
Undefined अपरिभाषित
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) "42" has size 2, s[0]='4'. Output: 24.
व्याख्या (हिन्दी) "42" का आकार 2 है, s[0]='4'। आउटपुट: 24.
🎯 Exam Perspective
अगर आप UPSC, SSC, Banking और Police भर्ती की तैयारी कर रहे हैं, तो OOP Using C++ ("Introduction to C++" sub-topic) का यह topic आपके लिए महत्वपूर्ण है। Exam में accuracy बढ़ाने के लिए हर सवाल की explanation जरूर पढ़ें।