MCQ Computer Science

Compilers Questions and Answers – Lexical Analysis – 2

This set of Compilers Multiple Choice Questions & Answers (MCQs) focuses on “Lexical Analysis – 2”.

 

  1. What constitutes the stages of the compilation process?
  2. a) Feasibility study, system, design, and testing
  3. b) Implementation and. documentation
  4. c) Lexical analysis, syntax. Analysis and code generation
  5. d) None of the mentioned

Answer

 

Answer: c

Explanation: As defined in the compilation process.

  1. The lexical analyzer takes_________as input and produces a stream of_______as output.
  2. a) Source program, tokens
  3. b) Token, source program
  4. c) Either of the two
  5. d) None of the mentioned

Answer

 

Answer: a

Explanation: As per the definition of Lexical Analyser which states that lexical analysis is the process of converting a sequence of characters into tokens.

  1. Parsing is also known as
  2. a) Lexical Analysis
  3. b) Syntax Analysis
  4. c) Semantic Analysis
  5. d) Code Generation

Answer

 

Answer: b

Explanation: Parsing or syntactic analysis is the process of analysing a string of symbols and conforming to the rules of grammar.

  1. A compiler program written in a high level language is called
  2. a) Source Program
  3. b) Object Program
  4. c) Machine Language Program
  5. d) None of the mentioned

Answer

 

Answer: a

Explanation: The input that we give in high level language is also known as the source language.

  1. System program such a compiler are designed so that they are
  2. a) Re-enterable
  3. b) Non-Usable
  4. c) Serially usable
  5. d) None of the mentioned

Answer

 

Answer: a

Explanation: For the convince of the user compilers are made re-enterable.

  1. Which of the following is not feature of compiler?
  2. a) Scan the entire program first and translate into machine code
  3. b) To remove syntax errors
  4. c) Slow for debugging
  5. d) Execution time is more

Answer

 

Answer: d

Explanation: The objective of the compiler is clearly not to increase the execution time of the program.

  1. A system program that brings together separately compiled modules of a program into a form language that is suitable for execution
  2. a) Assembler
  3. b) Linking loader
  4. c) Cross compiler
  5. d) None of the mentioned

Answer

 

Answer: b

Explanation: A loader which brings together the functions of a relocating loader with the ability to combine a number of program segments that have been independently compiled into an executable program.

  1. A programmer, by mistakes writes a program to multiply two numbers instead of dividing them, how can this error be detected
  2. a) Compiler
  3. b) Interpreter
  4. c) Compiler or interpreter
  5. d) None of the mentioned

Answer

 

Answer: d

Explanation: This is a logical error can’t be detected by any compiler or interpreter.

Tags

Related Articles

Leave a Reply

Your email address will not be published. Required fields are marked *

Close

Adblock Detected

Please consider supporting us by disabling your ad blocker