0
0
Compiler Designknowledge~10 mins

Compiler vs interpreter in Compiler Design - Interactive Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the sentence to describe what a compiler does.

Compiler Design
A compiler translates the entire [1] into machine code before execution.
Drag options to blanks, or click blank then click option'
Asource code
Boutput
Cerror
Dinput
Attempts:
3 left
💡 Hint
Common Mistakes
Confusing source code with output or input.
2fill in blank
medium

Complete the sentence to describe how an interpreter works.

Compiler Design
An interpreter translates and executes the program [1] at a time.
Drag options to blanks, or click blank then click option'
Aline
Bafter compilation
Call
Dbefore writing
Attempts:
3 left
💡 Hint
Common Mistakes
Thinking the interpreter translates the entire program before running.
3fill in blank
hard

Fix the error in the statement about compilers and interpreters.

Compiler Design
A compiler translates the program [1] executing it.
Drag options to blanks, or click blank then click option'
Awhile
Bafter
Cduring
Dbefore
Attempts:
3 left
💡 Hint
Common Mistakes
Choosing 'while' or 'during' which describe interpreters, not compilers.
4fill in blank
hard

Fill both blanks to complete the comparison between compiler and interpreter.

Compiler Design
A compiler translates [1] program, while an interpreter translates [2].
Drag options to blanks, or click blank then click option'
Athe whole
Bline by line
Conly part of
Dall at once
Attempts:
3 left
💡 Hint
Common Mistakes
Mixing up 'whole' and 'line by line'.
5fill in blank
hard

Fill all three blanks to explain the main difference in execution between compiler and interpreter.

Compiler Design
A compiler produces [1] code that runs [2], while an interpreter runs [3] code directly.
Drag options to blanks, or click blank then click option'
Amachine
Bfaster
Csource
Dslower
Attempts:
3 left
💡 Hint
Common Mistakes
Confusing machine code with source code or mixing up speed.