1 Programming Languages and Translators • Language Translators उच्च-स्तरीय भाषा में लिखे प्रोग्राम को मशीन-स्तरीय भाषा में कौन अनुवादित करता है? What translates a high-level language program into a machine-level language program? सेव करें Save सेव्ड Saved A. कंपाइलर Compiler B. असेंबलर Assembler C. लिंकर Linker D. कंपाइलर और असेंबलर Compiler and assembler उत्तर और व्याख्या देखें Show answer and explanation सही उत्तर: A Correct Answer: A कंपाइलर उच्च-स्तरीय भाषा के पूरे प्रोग्राम को मशीन कोड में अनुवादित करता है। असेंबलर असेंबली भाषा को मशीन कोड में बदलता है, जबकि लिंकर अलग-अलग ऑब्जेक्ट फाइलों को जोड़ता है। A compiler translates an entire high-level-language program into machine code. An assembler translates assembly language, while a linker combines object files.
2 Programming Languages and Translators • Language Translators असेंबली भाषा के प्रोग्राम को मशीन कोड में बदलने वाला अनुवादक कौन-सा है? Which translator converts an assembly-language program into machine code? सेव करें Save सेव्ड Saved A. लिंकर Linker B. असेंबलर Assembler C. लोडर Loader D. टेक्स्ट एडिटर Text editor उत्तर और व्याख्या देखें Show answer and explanation सही उत्तर: B Correct Answer: B असेंबलर असेंबली निर्देशों का मशीन कोड में अनुवाद करता है। यह लिंकर और लोडर से अलग कार्य करता है। An assembler translates assembly instructions into machine code. Its function differs from those of a linker and a loader.
3 Programming Languages and Translators • Language Translators कंपाइलर का मुख्य कार्य क्या है? What is the main function of a compiler? सेव करें Save सेव्ड Saved A. स्रोत प्रोग्राम का लक्ष्य कोड में अनुवाद करना To translate a source program into target code B. केवल प्रोग्राम की फाइल का नाम बदलना To rename a program file only C. हर प्रोग्राम का परिणाम सही होने की गारंटी देना To guarantee that every program produces correct results D. कंप्यूटर की RAM बढ़ाना To increase computer RAM उत्तर और व्याख्या देखें Show answer and explanation सही उत्तर: A Correct Answer: A कंपाइलर स्रोत कोड को लक्ष्य कोड में बदलता है। लक्ष्य कोड मशीन कोड, बाइटकोड या अन्य रूप हो सकता है; सफल संकलन तार्किक शुद्धता की गारंटी नहीं है। A compiler translates source code into target code, which may be machine code, bytecode or another form. Successful compilation does not guarantee logical correctness.
4 Programming Languages and Translators • Language Translators प्रोग्राम के निर्देशों की व्याख्या करके उनका निष्पादन कराने वाला सॉफ्टवेयर क्या कहलाता है? What is software that interprets program instructions and carries out their execution called? सेव करें Save सेव्ड Saved A. लिंकर Linker B. फाइल आर्काइवर File archiver C. इंटरप्रेटर Interpreter D. डिस्क फॉर्मेटर Disk formatter उत्तर और व्याख्या देखें Show answer and explanation सही उत्तर: C Correct Answer: C इंटरप्रेटर प्रोग्राम के निर्देशों का अर्थ समझकर उनका निष्पादन कराता है। वास्तविक प्रणालियों में इंटरप्रिटेशन और संकलन दोनों तकनीकें साथ उपयोग हो सकती हैं। An interpreter executes a program by interpreting its instructions. Real systems may combine interpretation and compilation.
5 Programming Languages and Translators • Language Translators C में जिस statement के अंत में semicolon आवश्यक है, वहाँ उसे छोड़ देना सामान्यतः किस प्रकार की त्रुटि है? In C, omitting a semicolon where one is required at the end of a statement is generally what type of error? सेव करें Save सेव्ड Saved A. हार्डवेयर त्रुटि Hardware error B. केवल नेटवर्क त्रुटि Only a network error C. केवल तार्किक त्रुटि Only a logical error D. Syntax error Syntax error उत्तर और व्याख्या देखें Show answer and explanation सही उत्तर: D Correct Answer: D आवश्यक semicolon छोड़ने से भाषा के व्याकरण का उल्लंघन होता है। Compiler सामान्यतः ऐसी syntax त्रुटि का निदान देता है। Omitting a required semicolon violates the language grammar. A compiler generally reports a diagnostic for such a syntax error.
6 Programming Languages and Translators • Language Translators Python में 10 / 0 निष्पादित करने पर सामान्यतः क्या होता है? What normally happens when 10 / 0 is executed in Python? सेव करें Save सेव्ड Saved A. परिणाम 0 मिलता है The result is 0 B. परिणाम 10 मिलता है The result is 10 C. ZeroDivisionError उत्पन्न होता है A ZeroDivisionError is raised D. यह केवल comment बन जाता है It becomes only a comment उत्तर और व्याख्या देखें Show answer and explanation सही उत्तर: C Correct Answer: C Python में शून्य से भाग देने पर ZeroDivisionError उत्पन्न होता है। यह निष्पादन के समय आने वाला exception है। Division by zero in Python raises ZeroDivisionError. This is an exception occurring during execution.
7 Programming Languages and Translators • Language Translators आयत का क्षेत्रफल निकालने वाला प्रोग्राम length × breadth के बजाय length + breadth करता है। यदि वह बिना रुके चलता है, तो मुख्य त्रुटि क्या है? A program calculates rectangle area using length + breadth instead of length × breadth. If it runs without stopping, what is the main error? सेव करें Save सेव्ड Saved A. Logical error Logical error B. अनिवार्य syntax error A necessary syntax error C. कीबोर्ड हार्डवेयर त्रुटि A keyboard hardware error D. फ़ाइल एक्सटेंशन त्रुटि A file-extension error उत्तर और व्याख्या देखें Show answer and explanation सही उत्तर: A Correct Answer: A प्रोग्राम चल रहा है, लेकिन सूत्र गलत है। यह logical error है, जिसमें निर्देश वैध हो सकते हैं लेकिन परिणाम अपेक्षित नहीं होता। The program runs but uses an incorrect formula. This is a logical error: instructions may be valid while producing an unintended result.
8 Programming Languages and Translators • Language Translators किसी प्रोग्राम का सफलतापूर्वक compile हो जाना क्या सुनिश्चित नहीं करता? What does successful compilation of a program not ensure? सेव करें Save सेव्ड Saved A. Compiler ने संबंधित source code को स्वीकार किया The compiler accepted the relevant source code B. उसके परिणाम हर वैध input के लिए सही होंगे Its results will be correct for every valid input C. उस चरण में compilation रोकने वाली त्रुटि रिपोर्ट नहीं हुई No compilation-blocking error was reported at that stage D. Compilation चरण पूरा हुआ The compilation stage completed उत्तर और व्याख्या देखें Show answer and explanation सही उत्तर: B Correct Answer: B Successful compilation सही तर्क या हर स्थिति में सफल निष्पादन की गारंटी नहीं है। Logical errors और runtime समस्याएँ फिर भी हो सकती हैं। Successful compilation does not guarantee correct logic or successful execution in every situation. Logical errors and runtime problems can still occur.