Which program translates and executes source code one line at a time during runtime?

An Interpreter is a language translator that converts and executes a program one statement at a time during runtime. Unlike a compiler, it does not translate the entire source code before execution. Instead, it reads each line of code, translates... Read More

1 PROGRAMMING MCQS

Which program translates and executes source code one line at a time during runtime?

  • Compiler
  • Linker
  • interpreter
  • Loader
Correct Answer: C. interpreter

Detailed Explanation

An Interpreter is a language translator that converts and executes a program one statement at a time during runtime. Unlike a compiler, it does not translate the entire source code before execution. Instead, it reads each line of code, translates it into machine language, and immediately executes it. This step-by-step approach makes Interpreter the correct answer.


One of the main advantages of an interpreter is that it detects errors as soon as they appear in the program. Since each statement is translated and executed individually, programmers can identify and correct mistakes without waiting for the entire program to be processed. This feature makes interpreters especially useful during software development and testing. Programming languages such as Python, JavaScript, and Ruby commonly rely on interpreters or interpreter-based execution environments.


Key Point:



  • An Interpreter translates and executes code line by line, whereas a Compiler translates the entire program before execution. Remembering this distinction makes it easier to answer similar questions in programming and competitive examinations.

Discussion

No comments yet. Be the first to share your thoughts!

Leave a Comment