Data Structures and Algorithms — MCQ Practice

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

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

Question 556

EN + हिं
GB The output of: int arr[]={1,2,3,4,5}; cout<<*max_element(arr,arr+5)<<" "<<*min_element(arr,arr+5);
IN इसका आउटपुट: int arr[]={1,2,3,4,5}; अदालत
5 1 5 1
1 5 1 5
3 1 3 1
Error गलती
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) Max=5, Min=1.
व्याख्या (हिन्दी) अधिकतम=5, न्यूनतम=1.
🎯 Exam Perspective
Data Structures and Algorithms ("Introduction to DSA" sub-topic) के इस प्रश्न को कई प्रतियोगी परीक्षाओं जैसे SSC CGL, IBPS, RRB और State-level परीक्षाओं में repeat होते देखा गया है। Concept clarity के लिए explanation section जरूर पढ़ें।

Question 557

EN + हिं
GB The output of: string s="Hello World"; transform(s.begin(),s.end(),s.begin(),toupper); cout<
IN इसका आउटपुट: स्ट्रिंग s='हैलो वर्ल्ड'; परिवर्तन(s.begin(),s.end(),s.begin(),toupper); अदालत
hello world हैलो वर्ल्ड
HELLO WORLD हैलो वर्ल्ड
Hello World हैलो वर्ल्ड
Error गलती
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) toupper converts each char to uppercase.
व्याख्या (हिन्दी) टॉपर प्रत्येक अक्षर को अपरकेस में परिवर्तित करता है।
🎯 Exam Perspective
यह सवाल Data Structures and Algorithms ("Introduction to DSA" sub-topic) category का है, और UPSC, SSC, Banking और Police भर्ती के exam pattern में इस तरह के questions common हैं। Answer choose करने के बाद दिया गया explanation जरूर पढ़ें।

Question 558

EN + हिं
GB The output of: vector v={1,2,3}; v.resize(5); cout<
IN का आउटपुट: वेक्टर v={1,2,3}; v.आकार बदलें(5); अदालत
Error गलती
3 3
Garbage कचरा
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) resize(5) adds 2 zero-initialized elements.
व्याख्या (हिन्दी) आकार बदलें (5) 2 शून्य-प्रारंभिक तत्व जोड़ता है।
🎯 Exam Perspective
यह प्रश्न Data Structures and Algorithms ("Introduction to DSA" sub-topic) की तैयारी करने वाले अभ्यर्थियों के लिए उपयोगी है। इस तरह के प्रश्न अक्सर Railway, SSC, Banking और Defence परीक्षाओं जैसी परीक्षाओं में पूछे जाते रहे हैं, इसलिए concept और explanation दोनों को ध्यान से समझें, सिर्फ उत्तर याद न करें।

Question 559

EN + हिं
GB The output of: string s="abcabc"; cout<
IN इसका आउटपुट: स्ट्रिंग s='abcabc'; अदालत
1 1
2 2
3 3
Error गलती
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) Two a characters in "abcabc".
व्याख्या (हिन्दी) "एबीसीएबीसी" में दो अक्षर।
🎯 Exam Perspective
Data Structures and Algorithms ("Introduction to DSA" sub-topic) से जुड़ा यह सवाल उन students के लिए काम का है जो SSC, Railway, Banking और State PCS की तैयारी कर रहे हैं। बेहतर होगा कि explanation पढ़कर concept clear करें, ताकि exam में similar प्रश्न आने पर confusion न हो।

Question 560

EN + हिं
GB The output of: cout<2)<<" "<<(2>3);
IN का आउटपुट: कॉउट
1 0 1 0
true false सच्चा झूठ
True False सच्चा झूठ
Error गलती
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) boolalpha mode: true/false words.
व्याख्या (हिन्दी) बूलल्फा मोड: सही/गलत शब्द।
🎯 Exam Perspective
SSC CGL, IBPS, RRB और State-level परीक्षाओं जैसी परीक्षाओं में Data Structures and Algorithms ("Introduction to DSA" sub-topic) से सवाल अक्सर पूछे जाते हैं। इसलिए सिर्फ answer रटने के बजाय, नीचे दी गई explanation को ध्यान से पढ़ें और concept समझें।

Question 561

EN + हिं
GB What is the output: int x=42; cout<
IN आउटपुट क्या है: int x=42; अदालत
2a 42 2ए 42
42 2a 42 2ए
0x2a 42 0x2a 42
Error गलती
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) 42 in hex = 2a; then back to decimal = 42.
व्याख्या (हिन्दी) हेक्स में 42 = 2ए; फिर दशमलव पर वापस = 42.
🎯 Exam Perspective
अगर आप UPSC, SSC, Banking और Police भर्ती की तैयारी कर रहे हैं, तो Data Structures and Algorithms ("Introduction to DSA" sub-topic) का यह topic आपके लिए महत्वपूर्ण है। Exam में accuracy बढ़ाने के लिए हर सवाल की explanation जरूर पढ़ें।

Question 562

EN + हिं
GB The output of: int a[]={1,2,3,4,5}; cout<
IN इसका आउटपुट: int a[]={1,2,3,4,5}; अदालत
5 5
4 4
20 20
1 1
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) 20 bytes total / 4 bytes per int = 5 elements.
व्याख्या (हिन्दी) कुल 20 बाइट्स / 4 बाइट्स प्रति इंट = 5 तत्व।
🎯 Exam Perspective
Data Structures and Algorithms ("Introduction to DSA" sub-topic) के इस प्रश्न को कई प्रतियोगी परीक्षाओं जैसे Railway, SSC, Banking और Defence परीक्षाओं में repeat होते देखा गया है। Concept clarity के लिए explanation section जरूर पढ़ें।

Question 563

EN + हिं
GB The output of: vector v={3,1,4,1,5,9}; sort(v.begin(),v.end()); v.erase(unique(v.begin(),v.end()),v.end()); cout<
IN का आउटपुट: वेक्टर v={3,1,4,1,5,9}; क्रमबद्ध करें (v.begin(),v.end()); v.erase(unique(v.begin(),v.end()),v.end()); अदालत
5 5
6 6
4 4
Error गलती
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) After removing duplicate 1: {1,3,4,5,9} = 5 elements.
व्याख्या (हिन्दी) डुप्लिकेट 1 को हटाने के बाद: {1,3,4,5,9} = 5 तत्व।
🎯 Exam Perspective
यह सवाल Data Structures and Algorithms ("Introduction to DSA" sub-topic) category का है, और SSC, Railway, Banking और State PCS के exam pattern में इस तरह के questions common हैं। Answer choose करने के बाद दिया गया explanation जरूर पढ़ें।

Question 564

EN + हिं
GB What is the output: map m={{1,10},{2,20},{3,30}}; for(auto [k,v]:m) cout<
IN आउटपुट क्या है: मानचित्र m={{1,10},{2,20},{3,30}}; for(ऑटो [k,v]:m) कॉउट
102030 102030
112233 112233
101020203030 101020203030
Error गलती
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) Structured binding: key value pairs 1 10 2 20 3 30.
व्याख्या (हिन्दी) संरचित बाइंडिंग: कुंजी मान जोड़े 1 10 2 20 3 30।
🎯 Exam Perspective
यह प्रश्न Data Structures and Algorithms ("Introduction to DSA" sub-topic) की तैयारी करने वाले अभ्यर्थियों के लिए उपयोगी है। इस तरह के प्रश्न अक्सर SSC CGL, IBPS, RRB और State-level परीक्षाओं जैसी परीक्षाओं में पूछे जाते रहे हैं, इसलिए concept और explanation दोनों को ध्यान से समझें, सिर्फ उत्तर याद न करें।

Question 565

EN + हिं
GB The output of: auto v=vector(5); iota(v.begin(),v.end(),1); cout<
IN का आउटपुट: ऑटो v=वेक्टर(5); iota(v.begin(),v.end(),1); अदालत
3 3
4 4
1 1
5 5
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) iota(begin,end,1) fills {1,2,3,4,5}; v[3]=4.
व्याख्या (हिन्दी) iota(शुरू, अंत,1) {1,2,3,4,5} भरता है; वी[3]=4.
🎯 Exam Perspective
Data Structures and Algorithms ("Introduction to DSA" sub-topic) से जुड़ा यह सवाल उन students के लिए काम का है जो UPSC, SSC, Banking और Police भर्ती की तैयारी कर रहे हैं। बेहतर होगा कि explanation पढ़कर concept clear करें, ताकि exam में similar प्रश्न आने पर confusion न हो।

Question 566

EN + हिं
GB The output of: int n=10; int sum=accumulate(begin({1,2,3,4,5,6,7,8,9,10}),end({1,2,3,4,5,6,7,8,9,10}),0); cout<
IN का आउटपुट: int n=10; पूर्णांक योग=संचय(शुरू({1,2,3,4,5,6,7,8,9,10}),अंत({1,2,3,4,5,6,7,8,9,10}),0); अदालत
50 50
55 55
45 45
100 100
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) Sum 1 to 10 = 55.
व्याख्या (हिन्दी) 1 से 10 का योग = 55.
🎯 Exam Perspective
Railway, SSC, Banking और Defence परीक्षाओं जैसी परीक्षाओं में Data Structures and Algorithms ("Introduction to DSA" sub-topic) से सवाल अक्सर पूछे जाते हैं। इसलिए सिर्फ answer रटने के बजाय, नीचे दी गई explanation को ध्यान से पढ़ें और concept समझें।

Question 567

EN + हिं
GB The output of: string s="Race Car"; remove_if(s.begin(),s.end(),::isspace); cout<
IN इसका आउटपुट: स्ट्रिंग s='रेस कार'; delete_if(s.begin(),s.end(),::isspace); अदालत
Race Car रेस कार
RaceCar रेसकार
raceCar रेसकार
Error गलती
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) remove_if does not actually erase; only rearranges.
व्याख्या (हिन्दी) delete_if वास्तव में मिटाता नहीं है; केवल पुनर्व्यवस्थित करता है।
🎯 Exam Perspective
अगर आप SSC, Railway, Banking और State PCS की तैयारी कर रहे हैं, तो Data Structures and Algorithms ("Introduction to DSA" sub-topic) का यह topic आपके लिए महत्वपूर्ण है। Exam में accuracy बढ़ाने के लिए हर सवाल की explanation जरूर पढ़ें।

Question 568

EN + हिं
GB The output of: auto s=set{5,3,1,4,2}; cout<
IN का आउटपुट: auto s=set{5,3,1,4,2}; अदालत
5 5
3 3
1 1
Error गलती
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) Set has 5 unique elements; distance = 5.
व्याख्या (हिन्दी) सेट में 5 अद्वितीय तत्व हैं; दूरी = 5.
🎯 Exam Perspective
Data Structures and Algorithms ("Introduction to DSA" sub-topic) के इस प्रश्न को कई प्रतियोगी परीक्षाओं जैसे SSC CGL, IBPS, RRB और State-level परीक्षाओं में repeat होते देखा गया है। Concept clarity के लिए explanation section जरूर पढ़ें।

Question 569

EN + हिं
GB The output of: int x=7; cout<<(x%2==0?"Even":"Odd")<<" "<<(x>0?"Pos":"NonPos");
IN का आउटपुट: int x=7; अदालत
Even Pos यहां तक ​​कि पॉज़
Odd Pos अजीब स्थिति
Even NonPos यहां तक ​​कि नॉनपोस भी
Odd NonPos अजीब नॉनपोज़
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) 7 is odd and positive.
व्याख्या (हिन्दी) 7 विषम और सकारात्मक है.
🎯 Exam Perspective
यह सवाल Data Structures and Algorithms ("Introduction to DSA" sub-topic) category का है, और UPSC, SSC, Banking और Police भर्ती के exam pattern में इस तरह के questions common हैं। Answer choose करने के बाद दिया गया explanation जरूर पढ़ें।

Question 570

EN + हिं
GB What is the output: int x=0; do {x++; if(x==3) break;} while(x<10); cout<
IN आउटपुट क्या है: int x=0; करो {x++; if(x==3) breaking;} while(x
3 3
10 10
4 4
Error गलती
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) Loop increments to 3, then breaks.
व्याख्या (हिन्दी) लूप 3 तक बढ़ता है, फिर टूट जाता है।
🎯 Exam Perspective
यह प्रश्न Data Structures and Algorithms ("Introduction to DSA" sub-topic) की तैयारी करने वाले अभ्यर्थियों के लिए उपयोगी है। इस तरह के प्रश्न अक्सर Railway, SSC, Banking और Defence परीक्षाओं जैसी परीक्षाओं में पूछे जाते रहे हैं, इसलिए concept और explanation दोनों को ध्यान से समझें, सिर्फ उत्तर याद न करें।