Data Structures and Algorithms — MCQ Practice

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

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

Question 931

EN + हिं
GB What is the output: format("{0} {1} {0}", "hello", "world"):
IN आउटपुट क्या है: प्रारूप ("{0} {1} {0}", "हैलो", "दुनिया"):
hello world hello नमस्ते विश्व नमस्कार
hello world हैलो वर्ल्ड
world hello world विश्व नमस्ते विश्व
Error गलती
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) std::format with positional args: {0}=hello, {1}=world.
व्याख्या (हिन्दी) std::स्थितीय तर्कों के साथ प्रारूप: {0}=हैलो, {1}=विश्व।
🎯 Exam Perspective
Data Structures and Algorithms से जुड़ा यह सवाल उन students के लिए काम का है जो SSC CGL, IBPS, RRB और State-level परीक्षाओं की तैयारी कर रहे हैं। बेहतर होगा कि explanation पढ़कर concept clear करें, ताकि exam में similar प्रश्न आने पर confusion न हो।

Question 932

EN + हिं
GB The output of: format("{:>10}", "hi"):
IN इसका आउटपुट: प्रारूप ("{:>10}", "हाय"):
hi नमस्ते
hi नमस्ते
hi नमस्ते
hixxxxxxxx hixxxxxxxxx
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) {:>10} right-aligns in width 10.
व्याख्या (हिन्दी) {:>10} चौड़ाई 10 में दाएँ-संरेखित।
🎯 Exam Perspective
UPSC, SSC, Banking और Police भर्ती जैसी परीक्षाओं में Data Structures and Algorithms से सवाल अक्सर पूछे जाते हैं। इसलिए सिर्फ answer रटने के बजाय, नीचे दी गई explanation को ध्यान से पढ़ें और concept समझें।

Question 933

EN + हिं
GB The output of: format("{:.2f}", 3.14159):
IN इसका आउटपुट: प्रारूप('{:.2f}', 3.14159):
3.14 3.14
3.1 3.1
3.142 3.142
3.14159 3.14159
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) {:.2f} formats float with 2 decimal places.
व्याख्या (हिन्दी) {:.2f} प्रारूप 2 दशमलव स्थानों के साथ तैरते हैं।
🎯 Exam Perspective
अगर आप Railway, SSC, Banking और Defence परीक्षाओं की तैयारी कर रहे हैं, तो Data Structures and Algorithms का यह topic आपके लिए महत्वपूर्ण है। Exam में accuracy बढ़ाने के लिए हर सवाल की explanation जरूर पढ़ें।

Question 934

EN + हिं
GB The output of: format("{:05d}", 42):
IN इसका आउटपुट: प्रारूप("{:05d}", 42):
00042 00042
42 42
42000 42000
Error गलती
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) {:05d} pads with zeros to width 5.
व्याख्या (हिन्दी) {:05d} शून्य से चौड़ाई 5 वाले पैड।
🎯 Exam Perspective
Data Structures and Algorithms के इस प्रश्न को कई प्रतियोगी परीक्षाओं जैसे SSC, Railway, Banking और State PCS में repeat होते देखा गया है। Concept clarity के लिए explanation section जरूर पढ़ें।

Question 935

EN + हिं
GB The output of: format("{:b}", 10):
IN इसका आउटपुट: प्रारूप ("{:b}", 10):
10 10
1010 1010
A
Error गलती
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) {:b} formats in binary; 10=1010.
व्याख्या (हिन्दी) {:b} बाइनरी में प्रारूप; 10=1010.
🎯 Exam Perspective
यह सवाल Data Structures and Algorithms category का है, और SSC CGL, IBPS, RRB और State-level परीक्षाओं के exam pattern में इस तरह के questions common हैं। Answer choose करने के बाद दिया गया explanation जरूर पढ़ें।

Question 936

EN + हिं
GB The output of: format("{:x}", 255):
IN इसका आउटपुट: प्रारूप ("{:x}", 255):
ff सीमांत बल
255 255
FF सीमांत बल
Error गलती
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) {:x} formats in lowercase hex; 255=ff.
व्याख्या (हिन्दी) {:x} लोअरकेस हेक्स में प्रारूप; 255=एफएफ.
🎯 Exam Perspective
यह प्रश्न Data Structures and Algorithms की तैयारी करने वाले अभ्यर्थियों के लिए उपयोगी है। इस तरह के प्रश्न अक्सर UPSC, SSC, Banking और Police भर्ती जैसी परीक्षाओं में पूछे जाते रहे हैं, इसलिए concept और explanation दोनों को ध्यान से समझें, सिर्फ उत्तर याद न करें।

Question 937

EN + हिं
GB The output of: format("{:o}", 8):
IN इसका आउटपुट: प्रारूप ("{:o}", 8):
8 8
10 10
0x8 0x8
Error गलती
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) {:o} formats in octal; 8=10 (octal).
व्याख्या (हिन्दी) अष्टाधारी में {:o} प्रारूप; 8=10 (अष्टक).
🎯 Exam Perspective
Data Structures and Algorithms से जुड़ा यह सवाल उन students के लिए काम का है जो Railway, SSC, Banking और Defence परीक्षाओं की तैयारी कर रहे हैं। बेहतर होगा कि explanation पढ़कर concept clear करें, ताकि exam में similar प्रश्न आने पर confusion न हो।

Question 938

EN + हिं
GB What is the output: string s=format("Hello, {}!", "World"); cout<
IN आउटपुट क्या है: स्ट्रिंग s=format('हैलो, {}!', 'वर्ल्ड'); अदालत
Hello, World! हैलो वर्ल्ड!
Hello, {}! नमस्ते, {}!
Error गलती
Hello World हैलो वर्ल्ड
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) std::format replaces {} with "World".
व्याख्या (हिन्दी) std::format {} को "World" से बदल देता है।
🎯 Exam Perspective
SSC, Railway, Banking और State PCS जैसी परीक्षाओं में Data Structures and Algorithms से सवाल अक्सर पूछे जाते हैं। इसलिए सिर्फ answer रटने के बजाय, नीचे दी गई explanation को ध्यान से पढ़ें और concept समझें।

Question 939

EN + हिं
GB The output of: auto r=views::iota(0,5); cout<
IN इसका आउटपुट: auto r=views::iota(0,5); अदालत
4 4
5 5
Error गलती
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) iota(0,5) generates 0,1,2,3,4; 5 elements.
व्याख्या (हिन्दी) iota(0,5) 0,1,2,3,4 उत्पन्न करता है; 5 तत्व.
🎯 Exam Perspective
अगर आप SSC CGL, IBPS, RRB और State-level परीक्षाओं की तैयारी कर रहे हैं, तो Data Structures and Algorithms का यह topic आपके लिए महत्वपूर्ण है। Exam में accuracy बढ़ाने के लिए हर सवाल की explanation जरूर पढ़ें।

Question 940

EN + हिं
GB The output of: vector v={1,2,3,4,5}; auto sum=ranges::fold_left(v,0,plus<>{}); cout<
IN का आउटपुट: वेक्टर v={1,2,3,4,5}; स्वचालित योग=श्रेणियाँ::fold_left(v,0,plus{}); अदालत
15 15
10 10
5 5
Error गलती
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) fold_left: 0+1+2+3+4+5=15.
व्याख्या (हिन्दी) फ़ोल्ड_लेफ्ट: 0+1+2+3+4+5=15.
🎯 Exam Perspective
Data Structures and Algorithms के इस प्रश्न को कई प्रतियोगी परीक्षाओं जैसे UPSC, SSC, Banking और Police भर्ती में repeat होते देखा गया है। Concept clarity के लिए explanation section जरूर पढ़ें।

Question 941

EN + हिं Medium
GB Which C++ keyword marks a variable as thread-local storage?
IN कौन सा C++ कीवर्ड एक वेरिएबल को थ्रेड-लोकल स्टोरेज के रूप में चिह्नित करता है?
static स्थिर
thread_local थ्रेड_लोकल
thread धागा
local स्थानीय
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) thread_local int x; each thread has its own x.
व्याख्या (हिन्दी) थ्रेड_लोकल int x; प्रत्येक धागे का अपना x होता है।
🎯 Exam Perspective
यह सवाल Data Structures and Algorithms category का है — difficulty level "Medium", और Railway, SSC, Banking और Defence परीक्षाओं के exam pattern में इस तरह के questions common हैं। Answer choose करने के बाद दिया गया explanation जरूर पढ़ें।

Question 942

EN + हिं
GB The output of: constexpr int sq(int n){return n*n;} static_assert(sq(5)==25); cout<<"OK";
IN इसका आउटपुट: constexpr int sq(int n){return n*n;} static_assert(sq(5)==25); अदालत
Error गलती
OK ठीक है
25 25
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) constexpr sq is evaluated at compile time; static_assert passes.
व्याख्या (हिन्दी) संकलन समय पर constexpr sq का मूल्यांकन किया जाता है; static_assert पास हो जाता है।
🎯 Exam Perspective
यह प्रश्न Data Structures and Algorithms की तैयारी करने वाले अभ्यर्थियों के लिए उपयोगी है। इस तरह के प्रश्न अक्सर SSC, Railway, Banking और State PCS जैसी परीक्षाओं में पूछे जाते रहे हैं, इसलिए concept और explanation दोनों को ध्यान से समझें, सिर्फ उत्तर याद न करें।

Question 943

EN + हिं Medium
GB static_assert in C++ checks:
IN C++ जाँच में static_assert:
Runtime assertion रनटाइम दावा
Compile-time assertion; program fails to compile if condition is false संकलन-समय का दावा; यदि स्थिति गलत है तो प्रोग्राम संकलित करने में विफल रहता है
Dynamic assertion गतिशील दावा
Memory assertion स्मृति दावा
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) static_assert(condition, "message") is a compile-time check.
व्याख्या (हिन्दी) static_assert(condition, "message") एक संकलन-समय जाँच है।
🎯 Exam Perspective
Data Structures and Algorithms से जुड़ा यह सवाल — difficulty level "Medium" उन students के लिए काम का है जो SSC CGL, IBPS, RRB और State-level परीक्षाओं की तैयारी कर रहे हैं। बेहतर होगा कि explanation पढ़कर concept clear करें, ताकि exam में similar प्रश्न आने पर confusion न हो।

Question 944

EN + हिं
GB The output of: template void f(T&&x){cout<::value;} int a=5; f(a); f(5);
IN इसका आउटपुट: टेम्पलेट शून्य f(T&&x){cout
10 10
01 01
11 11
00 00
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) f(a): T deduced as int& (lvalue ref = 1); f(5): T deduced as int (rvalue = 0).
व्याख्या (हिन्दी) f(a): T को int& के रूप में निकाला गया (lvalue Ref = 1); f(5): T को int (rvalue = 0) के रूप में निकाला गया।
🎯 Exam Perspective
UPSC, SSC, Banking और Police भर्ती जैसी परीक्षाओं में Data Structures and Algorithms से सवाल अक्सर पूछे जाते हैं। इसलिए सिर्फ answer रटने के बजाय, नीचे दी गई explanation को ध्यान से पढ़ें और concept समझें।

Question 945

EN + हिं
GB What is the output: int arr[3][3]={{1,2,3},{4,5,6},{7,8,9}}; cout<
IN आउटपुट क्या है: int arr[3][3]={{1,2,3},{4,5,6},{7,8,9}}; अदालत
5 5
6 6
7 7
8 8
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) arr[1][2]: row 1 (second row), col 2 (third col) = 6.
व्याख्या (हिन्दी) एआर[1][2]: पंक्ति 1 (दूसरी पंक्ति), कॉलम 2 (तीसरा कॉलम) = 6।
🎯 Exam Perspective
अगर आप Railway, SSC, Banking और Defence परीक्षाओं की तैयारी कर रहे हैं, तो Data Structures and Algorithms का यह topic आपके लिए महत्वपूर्ण है। Exam में accuracy बढ़ाने के लिए हर सवाल की explanation जरूर पढ़ें।