General KnowledgeHardSSC CGL · SSC CHSL

Which statement correctly distinguishes a compiler from an interpreter?

  1. A. A compiler translates a program statement by statement while it runs, and an interpreter translates the whole program first
  2. B. A compiler translates the whole source program into machine code before execution, while an interpreter translates and runs it statement by statement
  3. C. A compiler runs only assembly programs, and an interpreter runs only high-level programs
  4. D. A compiler produces output only when the program has no errors, and an interpreter never reports errors

Correct answer: B. A compiler translates the whole source program into machine code before execution, while an interpreter translates and runs it statement by statement

A compiler converts the entire source program to machine code ahead of execution and reports errors for the whole program, whereas an interpreter reads, translates and executes one statement at a time.

हिंदी में

कंपाइलर और इंटरप्रेटर में सही अंतर कौन-सा कथन बताता है?

  1. A. कंपाइलर प्रोग्राम को चलते समय एक-एक कथन करके अनुवाद करता है, और इंटरप्रेटर पहले पूरे प्रोग्राम का अनुवाद करता है
  2. B. कंपाइलर पूरे स्रोत प्रोग्राम को निष्पादन से पहले मशीन कोड में बदल देता है, जबकि इंटरप्रेटर एक-एक कथन का अनुवाद करके उसे चलाता है
  3. C. कंपाइलर केवल असेंबली प्रोग्राम चलाता है, और इंटरप्रेटर केवल उच्च-स्तरीय प्रोग्राम चलाता है
  4. D. कंपाइलर तभी आउटपुट देता है जब प्रोग्राम में कोई त्रुटि न हो, और इंटरप्रेटर कभी त्रुटि नहीं बताता

उत्तर: B. कंपाइलर पूरे स्रोत प्रोग्राम को निष्पादन से पहले मशीन कोड में बदलता है और पूरे प्रोग्राम की त्रुटियाँ बताता है, जबकि इंटरप्रेटर एक बार में एक कथन पढ़ता, अनुवाद करता और चलाता है।

More Science and Technology (Space, Defence, IT) questions

Exams that ask this topic