Difference between Compiler and Interpreter

NoCompilerInterpreter
1Compiler Takes Entire program as inputInterpreter Takes Single instruction as input .
2Intermediate Object Code is GeneratedNo Intermediate Object Code is Generated
3Conditional Control Statements are Executes fasterConditional Control Statements are Executes slower
4Memory Requirement : More (Since Object Code is Generated)Memory Requirement is Less
5Program need not be compiled every timeEvery time higher level program is converted into lower level program
6Errors are displayed after entire program is checkedErrors are displayed for every instruction interpreted (if any)
7Example : C CompilerExample : BASIC

Explanation : Compiler Vs Interpreter

Just understand the concept of the compiler and interpreter –

  1. We give complete program as input to the compiler. Our program is in the human readable format.
  2. Human readable format undergoes many passes and phases of compiler and finally it is converted into the machine readable format.
  3. However interpreter takes single line of code as input at a time and execute that line. It will terminate the execution of the code as soon as it finds the error.
  4. Memory requirement is less in Case of interpreter because no object code is created in case of interpreter.

Quantitative Aptitude
Reasoning
Programming
Interview