Compiler Design MCQ Online Test 2021

Compiler Design MCQ Online Test

Compiler Design MCQ is one of the largest searchable categories across the world. keep reading and practicing for tests, exams, and interviews for professional fields. there are thousands of selected questions with answers.

How many alphabets are there in the Binary language?

A. 2
B. 3
C. 4
D. 5

Answer

A

Binary numbers are eight characters in length where every character is either a 1 or 0. The placement of each 1 indicates the value of that position, which is used to calculate the total value of the binary number.

 

 We write programs in?

A. Low-Level Language
B. Middle-Level Language
C. High-Level Language
D. Decimal-Format

Answer

C

we write programs in a high-level language, which is easier for us to understand and remember.

 

 _______ is a program that converts high-level language to assembly language.

A. assembler
B. compiler
C. interpreter
D. linker

Answer

B

A compiler is a program that converts high-level language to assembly language.

 

A compiler that runs on the platform (A) and is capable of generating executable code for the platform (B) is called?

A. cross-compiler
B. complex-compiler
C. object-compiler
D. post-compiler

Answer

B

A compiler is a program that converts high-level language to assembly language.

 

Which of the following is used to link all the parts of the program together for execution?

A. loader
B. linker
C. memory
D. preprocessor

Answer

B

A linker tool is used to link all the parts of the program together for execution (executable machine code).

 

Which of the following tool produces input for compilers?

A. Interpreter
B. Assembler
C. Loader
D. Preprocessor

Answer

D

A preprocessor, generally considered as a part of a compiler, is a tool that produces input for compilers. It deals with macro-processing, augmentation, file inclusion, language extension, etc.

 

Does compiler read the whole source code at once?

A. Yes
B. No
C. Depends on compiler
D. Don’t know

Answer

A

An interpreter, like a compiler, translates high-level language into low-level machine language. … A compiler reads the whole source code at once, creates tokens, checks semantics, generates intermediate code, executes the whole program, and may involve many passes.

 

If an error occurs, what interpreter do?

A. terminate program
B. stops execution
C. reads the whole program even if it encounters errors
D. give warning

Answer

B

In contrast, an interpreter reads a statement from the input, converts it to an intermediate code, executes it, then takes the next statement in sequence. If an error occurs, an interpreter stops execution and reports it. whereas a compiler reads the whole program even if it encounters several errors.

 

If an error occurs, what compiler do?

A. terminate program
B. stops execution
C. reads the whole program even if it encounters errors
D. give warning

Answer

C

A compiler searches all the errors of a program and lists them. If the program is error-free then it converts the code of the program into machine code and then the program can be executed by separate commands. An interpreter checks the errors of a program statement by statement.

The output of an assembler is called?

A. data file
B. task file
C. object file
D. program file

Answer

C

The output of the assembler program is called the object code or object program relative to the input source program. The sequence of 0’s and 1’s that constitute the object program is sometimes called machine code

 

 

 

Leave a Reply