Compiler Design MCQ Questions And Answers

The following quiz “Compiler Design MCQ Questions And Answers” provide Multiple Choice Questions (MCQs) related to Compiler Design. These Compiler Design MCQs are also Interviews (campus interview, walk-in interview, company interview), Placement or recruitment, entrance examinations, and competitive examinations oriented. You can practice the below questions to improve your Compiler Design skills. You can click on the View Answer button to check the answer. Let’s solve this Compiler Design MCQ Questions And Answers Quiz. Compiler Design is the structure and set of principles that provide an in-depth view of the translation, analysis, and optimization process of a compiler.

You can practice these Compiler Design MCQs here and if you want a pdf of Compiler Design MCQ Questions And Answers, we will provide a downloading link here soon so please keep visiting here for further modifications.

1. What is a compiler?

  1. System program that converts instructions to machine language
  2. System program that writes instructions to perform
  3. System program that converts machine language to high-level language
  4. None of the above

Answer : A
Explanation: A compiler is a system program that converts instructions to machine understandable language.

2. What is the action of parsing the source program into proper syntactic classes known as?

  1. Interpretation analysis
  2. Lexical analysis
  3. General syntax analysis
  4. Syntax analysis

Answer : B
Explanation: The action of parsing the source program into proper syntactic classes known as Lexical analysis. So, option B is correct.

3. Users write the programs in which language?

  1. Decimal-Format
  2. Low-level Language
  3. High-Level Language
  4. Middle-Level Language

Answer : C
Explanation: Users write the program in a high-level language because it is easier to learn, use, understand and remember. So, option C is correct.

4. The number of tokens in the following C code segment is

switch (input_value)

{

case 1 : b = c * d ; break ;

default : b = b + + ; break ;

}

  1. 24
  2. 27
  3. 29
  4. 26

Answer : D
Explanation: A token is a sequence of characters that can be treated as a unit in the grammar of the programming languages. Here in above case, the tokens are: switch, (, input_value, ), {, case, 1, :, b, =, c, *, d, ;, break, ;, default, :, b, =, b, ++, ;, break, ; and }. Total 26 tokens.

5. Which table is a permanent database that has an entry for each terminal symbol?

  1. Terminal table
  2. Identifier table
  3. Literal table
  4. Reductions

Answer : A
Explanation: Terminal table is a permanent database that has an entry for each terminal symbol.

Neural Networks MCQ Questions And Answers

6. A compiler is preferable to an interpreter because

  1. If one changes a statement, only that statement needs re-compilation
  2. Debugging can be faster and easier
  3. It is much helpful in the initial stages of program development
  4. It can generate stand alone programs that often take less time for execution

Answer : D
Explanation: A compiler is preferable to an interpreter because it can generate stand alone programs that often take less time for execution.

7. A optimizing compiler

  1. Is optimized to take less time for execution
  2. Optimized the code
  3. Is optimized to occupy less space
  4. None of the above

Answer : B
Explanation: A optimizing compiler Optimized the code.

8. Compiler should report the presence of ________ in the source program, in the translation process.

  1. Objects
  2. Classes
  3. Errors
  4. Text

Answer : C
Explanation: Compiler should report the presence of errors in the source program, in translation process.

9. Which of the following is a stage of compiler design?

  1. Intermediate code generator
  2. Code generator
  3. Semantic analysis
  4. All of the above

Answer : D
Explanation: All of the above is a stage of compiler design, the phases of a compiler design are: Lexical analysis, Syntax analysis, Semantic analysis, Intermediate code generator, Code optimizer and Code generator.

10. What does a bottom-up parser generate?

  1. Right-most derivation in reverse
  2. Left-most derivation
  3. Right-most derivation
  4. Left-most derivation in reverse

Answer : A
Explanation: A bottom-up parser generate right-most derivation in reverse.

Leave a Reply