What is a difference between a compiler and an interpreter?

(1 point)
An interpreter creates an executable file.
A compiler creates an executable file.
A compiler is source code.
An interpreter is source code.

The correct answer is: A compiler is source code and an interpreter is source code.

A compiler is a program that translates the entire source code into machine code or bytecode before executing it. It scans and analyzes the entire code and generates an executable file that can be directly executed by the computer.

On the other hand, an interpreter reads and executes the code line by line or statement by statement. It does not generate an executable file. Instead, it directly interprets and executes the source code on the fly, translating and executing each line or statement sequentially.

So, both a compiler and an interpreter deal with source code, but they differ in the way they execute it.