1 Programming Languages and Translators • Translators and Errors C में जिस statement के अंत में semicolon आवश्यक है, वहाँ उसे छोड़ देना सामान्यतः किस प्रकार की त्रुटि है? In C, omitting a semicolon where one is required at the end of a statement is generally what type of error? 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.
2 Programming Languages and Translators • Translators and Errors Python में 10 / 0 निष्पादित करने पर सामान्यतः क्या होता है? What normally happens when 10 / 0 is executed in Python? 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.
3 Programming Languages and Translators • Translators and Errors आयत का क्षेत्रफल निकालने वाला प्रोग्राम 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? 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.
4 Programming Languages and Translators • Translators and Errors किसी प्रोग्राम का सफलतापूर्वक compile हो जाना क्या सुनिश्चित नहीं करता? What does successful compilation of a program not ensure? 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.