Question:

Which of the following converts source code to machine code?

Show Hint

Compiler converts the complete source code into machine code before execution. Interpreter executes the program line by line.
Updated On: May 18, 2026
  • Compiler
  • ANSI
  • HSP
  • Interpreter
Show Solution
collegedunia
Verified By Collegedunia

The Correct Option is A

Solution and Explanation

Concept:
A computer can directly understand only machine code, which is written in binary form. Source code written by programmers in high-level languages must be converted into machine code before execution.

Step 1: Understand source code.

Source code is the program written by a programmer using a high-level language such as C, C++, Java, or Python.

Step 2: Understand machine code.

Machine code is the binary instruction format that can be directly executed by the CPU. \[ \text{Machine code} = \text{Binary instructions understood by computer} \]

Step 3: Role of compiler.

A compiler translates the entire source code into machine code or object code before execution. \[ \text{Source Code} \xrightarrow{\text{Compiler}} \text{Machine Code} \]

Step 4: Compare with interpreter.

An interpreter translates and executes code line by line. It does not generally convert the complete source program into machine code at once like a compiler.

Step 5: Check other options.

ANSI is a standards organization, not a translator.
HSP is not the correct answer here.
Interpreter translates line by line, but the standard answer for converting source code to machine code is compiler. Therefore: \[ \text{Compiler converts source code into machine code.} \] \[ \therefore \text{Correct Answer is (A)} \]
Was this answer helpful?
0
0