Difference between Interpreter and Compiler.

Q3. What is the difference between an interpreter and a compiler?

Ans. An interpreter converts an HLL program into machine language line by line and simultaneously executes the converted line. Also, an interpreter must always be present in the memory along with the program for its execution. If an error occurs in a line, the line is displayed and interpreter does not proceed unless the error is rectified.

A compiler converts an HLL program into machine language in one go. If there are errors in the program, its gives the error list along with the line numbers. Once the errors are removed, error-free object code is made available and after this compiler is no more needed in the memory.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s