CS Professional · Artificial Intelligence, Data Analytics and Cyber Security - Laws and Practice · Computer Hardware and Software
A company secretary asks a developer to explain the difference between a compiler and an interpreter. Which statement is correct?
A compiler translates the entire source program into machine code before execution, whereas an interpreter translates and executes the program statement by statement. The other options reverse these roles or wrongly limit each translator to assembly or machine language.
- AA compiler translates the whole source program into machine code before execution, while an interpreter translates and executes it statement by statementCorrect
- BAn interpreter translates the whole program into an object file before execution, while a compiler runs it line by line
- CBoth translate only one statement at a time, but a compiler stores the output in RAM
- DA compiler is used only for assembly language, while an interpreter is used only for machine language
Explanation
A compiler converts the entire source code into object/machine code in one pass before running, and reports errors after analysing the whole program. An interpreter reads, translates and executes one statement at a time. The second option reverses the two roles.
Did you get it right without looking?
One question tells you little. A timed set on Computer Hardware and Software shows your real accuracy, how long you take and where you lose marks.
More Computer Hardware and Software questions
- In a computer's von Neumann-style architecture, which component fetches instructions from memory, decodes them and directs the other units t…
- Which of the following correctly matches a computer type with its typical use?
- Under the Information Technology Act, 2000, a person who dishonestly or fraudulently tampers with computer source code that the law requires…
- A company secretary is asked to explain why a newly bought laptop cannot run any application until a particular layer of software is loaded.…
- A bank's data centre in Mumbai runs a large, highly reliable machine that handles thousands of concurrent users and millions of transactions…
- An IT manager at an Indian firm notices that a system with limited RAM keeps running large programs by temporarily moving inactive portions …