What is the primary difference between an interpreter and a compiler in programming language execution?

Answer and explanation

Correct answer: D. both perform lexical syntax analysis concurrently without generating intermediate representations

  1. Step 1: Compilers (such as C/C++) produce standalone binary machine executables through scanning, parsing, and optimization stages. Step 2. Interpreters (such as standard Python or Ruby) analyze and execute program instructions interactively statement by statement. Answer: A compiler translates the entire source code into machine code prior to execution, whereas an interpreter executes source statements line-by-line. Why not the others: Compilers execute before runtime; interpreters execute during runtime; compilers detect syntax errors during compilation.

Practise more Computer Systems, Networking and ICT.

Free questions with an explanation for every one, and full timed Bangladesh Civil Service Preliminary Examination mock tests.