Relative to the program translated by a compiler, the same program when interpreted runs
(A) Faster
(B) Slower
(C) At the same speed
(D) May be faster or slower
Answer: (B)
Explanation: Interpreter translates program one statement at a time. Scans the entire program and translates it as a whole into machine code. It takes less amount of time to analyze the source code but the overall execution time is slower.
Compiler scans the entire program and translates it as a whole into machine code. It takes large amount of time to analyze the source code but the overall execution time is comparatively faster.
So, option (B) is correct.
Quiz of this Question