x

Choose Country Code

x

Direction

x

Ask a Question

  • Ask a Question
  • Scan a Question
  • Post MCQ
  • Note: File extension must be of jpg, jpeg, png, bmp format and file size must not exceed 5 MB
x

Ask a Question

x

x
x
x
Hire a Tutor

Answers and Solutions

What's Your Question?
Answer
Compiler compile the complete program in one go while interpreter do it line by line.
Answer
Compiler Takes Entire program as input, Interpreter Takes Single instruction as input .
Answer
Interpreter Compiler 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. It takes large amount of time to analyze the source code but the overall execution time is comparatively faster. No intermediate object code is generated, hence are memory efficient. Generates intermediate object code which further requires linking, hence requires more memory. Continues translating the program until the first error is met, in which case it stops. Hence debugging is easy. It generates the error message only after scanning the whole program. Hence debugging is comparatively hard. Programming language like Python, Ruby use interpreters. Programming language like C, C++ use compilers.
Answer

We need to convert the source code into machine code and this is accomplished mycompilers and interpreters. Hence, a compiler or an interpreter is a program that converts program written in high-level language into machine code understood by the computer.

Answer

We give complete program as input to the compiler. Our program is in the human readable format. Human readable format undergoes many passes and phases of compiler and finally it is converted into the machine readable format.

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.

Memory requirement is less in Case of interpreter because no object code is created in case of interpreter.

Answer

Compiler converts high level program into machine level in one go

Interpreter converts high level into machine level line by line

Answer

Computer understands only machine language i.e binary language (0 & 1).Programs written by programmer are written in High Level Languages. So High Level programs need to be translated into machine language with the help of translator programs. There are 2 types of translator programs:

1) Interpreter -

   * It converts high level language program into machine language line by line. It converts one line,

     executes the instruction and then repeats the procedure for the remaining instructions.

   * If any errors are found they are to be immediately removed.

   * Converted form is not stored anywhere and has to be regenerated everytime.

   * Preferred for beginners

   * These are slow in execution speed.

2) Compiler-

   * It converts high level language program into machine language. It converts whole page at once.

    It generates the object code for the program alongwith a list of errors, if any.

   * The execution speed is very fast.

Answer

COMPILER:

Compiler takes ENTIRE progarm as input.

INTERMEDIATE object code is generated.

Conditional control statement executes FASTER .

MEMORY REQUIREMENTS: MORE

Program not need to COMPILED Everytime.

ERRORS are displayed after entire Program is executed.

EXAMPLE :C COMPLIER

NOW INTERPRETOR:

Interpreter Takes Single instruction as input .

No Intermediate Object Code isGenerated

Conditional Control Statements are Executes slower

Memory Requirement : Less

Every time higher level program is converted into lower level program

Errors are displayed for every instruction interpreted (if any)

Example : BASIC

Answer

Guess you are aware that computer speaks only one language(i.e binary :- everything in terms of 0s and 1s) at which humans are very bad or not comfortable. We write programs which are then converted into binary code using the compiler or interpreter. Hence, a compiler or an interpreter is a program that converts program written in high-level language into machine-level language.

So destiny for both Complier/interpreter same but the way they work is different.

Interpreter: 1.converts only one statement of a program at an instance of time to binary. 2.So, as interpreter checks the errors of a program statement by statement. After checking one statement, it converts that statement into machine code and then executes that statement. The process continues until the last statement of program occurs. 3.Interpreter does not generate any machine/object code. 4.As they don't generate any machine/object code, occupies less memory (memory efficient) 5.interpreted programs are to interpreted everytime they are run. 6.Debugging is easy. 7.Interpreter runs the program from first line and stops execution only if it encounters an error.

Compiler: 1.Converts entire statements of program to binary at once. 2.So, a compiler searches for all errors in a program and lists. If the program/code is error free then, it converts into machine code and then the program can be executed. 3.As entire code gets converted and has to keep in memory, compiler generates separate code called machine/object code. 4.Compiled programs takes more memory because of the way it work. 5.compiled programmed need not be complied everytime.i.e compile once and run manytimes. 6.Debugging is not easy. 7.Compiler does not allow a program to run until it is fully error-free.

Answer
Compiler and Interpreter both are used as translator for transforming High level language to Machine level language. Interpreter does line by line where as compiler does it at a time.

Post Answer and Earn Credit Points

Get 5 credit points for each correct answer. The best one gets 25 in all.

Post Answer