- Compiler takes entire program as input where as interpreter takes single line instruction. so conditional statement executed fast in compiler than the interpreter
- intermediate code is generated in compiler whereas no intermediate code in interpreter
- program is compile once and executed many times until we not changed the program whereas in interpreter the program is translated into high level language to low level language ex: C compiler and any browser uses interpreter.
So in short when a user writes a code in a high level language such as C and wants it to execute, C compiler is used before it will be executed. The compiler scans the entire program first and then translates it into machine code which will be executed by the computer processor and the corresponding tasks will be performed. Now coming to Interpreter, they also convert the high level language into machine readable binary equivalents. Each time when an interpreter gets a high level language code to be executed, it converts the code into an intermediate code before converting it into the machine code. Each part of the code is interpreted and then execute separately in a sequence.