Generic selectors
Exact matches only
Search in title
Search in content
Search in posts
Search in pages
Filter by Categories
nmims post
Objective Type Set
Online MCQ Assignment
Question Solution
Solved Question
Uncategorized

Multiple choice question for engineering

Set 1

1. In which addressing mode the operand is given explicitly in the instruction?
a) Absolute mode
b) Immediate mode
c) Indirect mode
d) Index mode

View Answer

Answer: b [Reason:] In Immediate addressing mode operand is directly found from the instruction.

2. Which of the following is not true?
a) UGL doesn’t support high level seven interaction
b) Many DBMS support 4GLs
c) All of the mentioned
d) None of the mentioned

View Answer

Answer: a [Reason:] It supports HLL

3. Non modifiable procedures are called
a) Concurrent procedures
b) Serially usable procedures
c) Re-entrant procedures
d) Top down procedures

View Answer

Answer: b [Reason:] These can’t be modified

4. Which of the following is not a type of assembler?
a) One pass
b) Two pass
c) Three pass
d) Load and go

View Answer

Answer : c [Reason:] No 3 pass assembler created as yet

5. Daisy chain is a device for
a) None of the mentioned
b) Connecting devices to a controller
c) Connecting controller to devices
d) All of the mentioned

View Answer

Answer: b [Reason:] Combines multiple devices in sequence or a ring

6. Input of Lex is
a) Set to regular expression
b) Statement
c) Numeric data
d) ASCII data

View Answer

Answer: an [Reason:] Input is a string.

7. Yacc semantic action is a sequence of
a) Tokens
b) Expression
c) Statement
d) Rules

View Answer

Answer: c [Reason:] Yacc is yet another compiler which is a set of statements.

8. Which of the following software tool is parser generator?
a) Lex
b) Yacc
c) Both of the mentioned
d) None of the mentioned

View Answer

Answer: b [Reason:] YACC is a LALR parser.

9. A Lex compiler generates
a) Lex object code
b) Transition tables
c) Tokens
d) None of the mentioned

View Answer

Answer: b [Reason:] the output of Lex is a string of tokens.

10. A Compiler has __________ phases .
a) 7
b) 6
c) 8
d) None of the mentioned

View Answer

Answer: c [Reason:] It has 8 phases.

Set 2

1. Grammar that produce more than one Parse tree for same sentence is
a) Ambiguous
b) Unambiguous
c) Complementary
d) Concatenation Intersection

View Answer

Answer: a [Reason:] An ambiguous grammar is one for which there is more than one parse tree for a single sentence.

2. Automaton accepting the regular expression of any number of a ‘ s is
a) a*
b) ab*
c) (a/b)*
d) a*b*c

View Answer

Answer: a [Reason:] It gives any number of a’s.

3. Grammars that can be translated to DFAs:
a) Left linear grammar
b) Right linear grammar
c) Generic grammar
d) All of the mentioned

View Answer

Answer: b [Reason:] Right linear grammar can be translated to the DFAs.

4. The language accepted by a Push down Automata
a) Type0
b) Type1
c) Type2
d) Type3

View Answer

Answer: c [Reason:] A known fact that type 2 grammar is accepted by PDA.

5. Given the following statements : (i) Recursive enumerable sets are closed under complementation. (ii) Recursive sets are closed under complements. Which is/are the correct statements ?
a) I only
b) II only
c) Both I and II
d) Neither I nor II

View Answer

Answer: b [Reason:] Recursive languages are closed under the following operations. The Kleene star L * of L the concatenation L * o P of L and P the union L U P the intersection L ∩ P.

6. Assume statements S1 and S2 defined as : S1 : L2-L1 is recursive enumerable where L1 and L2 are recursive and recursive enumerable respectively. S2 : The set of all Turing machines is countable. Which of the following is true ?
a) S1 is correct and S2 is not correct.
b) Both S1 and S2 are correct.
c) Both S1 and S2 are not correct.
d) S1 is not correct and S2 is correct.

View Answer

Answer: b [Reason:] The assumptions of statement S1 and S2 are correct.

7. A context free language is called ambiguous if
a) It has 2 or more left derivations for some terminal string ѡ є L (G)
b) It has 2 or more right derivations for some terminal string ѡ є L (G)
c) Both of th ementioned
d) None of the mentioned

View Answer

Answer: b [Reason:] A context-free grammar (CFG) is a set of recursive rewriting rules (or productions) used to generate patterns of strings.

Set 3

1. Which of the following statement is false?
a) The CFG can be converted to Chomsky normal form
b) The CFG can be converted to Greibach normal form
c) CFG is accepted by push down automata
d) None of the mentioned

View Answer

Answer: d [Reason:] All the statements follow the rules.

2. The context free grammar S → A111|S1, A → A0 | 00 is equivalent to
a) {0ⁿ1ᵐ | n=2, m=3}
b) {0ⁿ1ᵐ | n=1, m=5}
c) {0ⁿ1ᵐ | n should be greater than two and m should be greater than four}
d) None of these

View Answer

Answer: a [Reason:] S-> A111 S->00111 (A->00).

3. The context free grammar S → SS | 0S1 | 1S0 | ɛ generates
a) Equal number of 0’s and 1’s
b) Unequal number of 0’s and 1’s
c) Number of 0’s followed by any number of 1’s
d) None of the mentioned

View Answer

Answer: a [Reason:] S->SS S->0S1S S->0S11S0 S->0110.

4. Which of the following statement is false?
a) In derivation tree, the label of each leaf node is terminal
b) In derivation tree, the label of all nodes except leaf nodes is a variable
c) In derivation tree, if the root of a sub tree is X then it is called –tree
d) None of the mentioned

View Answer

Answer: d [Reason:] All of them are true regarding a derivation tree.

5. Push down automata accepts which language
a) Context sensitive language
b) Context free language
c) Recursive language
d) None of the mentioned

View Answer

Answer: b [Reason:] PDA accepts CFG.

6. A regular Grammar is a
a) CFG
b) Non CFG
c) English Grammar
d) None of the mentioned

View Answer

Answer: a [Reason:] Regular grammar is CFG. It restricts its rules to a single non terminal on left hand side.

7. A CFG is closed under
a) Union
b) Kleene star
c) Concatenation
d) None of the mentioned

View Answer

Answer: d [Reason:] CFG is closed under the above mentioned 3 operations.

8. Which of these does not belong to CFG?
a) Terminal Symbol
b) Non terminal Symbol
c) Start symbol
d) End Symbol

View Answer

Answer: d [Reason:] CFG consist of terminal non terminal start symbol set of production rules but does not have an end symbol.

Set 4

1. Compiler can diagnose
a) Grammatical errors only
b) Logical errors only
c) Grammatical and logical errors
d) None of the mentioned

View Answer

Answer: a [Reason:] Only syntactical errors can be detected by the compiler.

2. A simple two-pass assembler does which of the following in the first pass?
a) It allocates space for the literals
b) Calculates total length of the program
c) Symbol table is built for the symbols and their value
d) All of the mentioned

View Answer

Answer: d [Reason:] A two-pass assembler. Each pass scans the program, the first pass generates the symbol table and the second pass generates the machine code…

3. A system program that set-up an executable program in main memory ready for execution is
a) Assembler
b) Linker
c) Loader
d) Text editor

View Answer

Answer: c [Reason:] A loader is the part of an operating system that is responsible for loading programs and libraries. It is important that with the starting of a program, as it places programs into memory and executes it.

4. A compiler is a program that
a) Program is put into memory and executes it
b) Translation of assembly language into machine language
c) Acceptance of a program written in a high level language and produces an object program
d) None of the mentioned

View Answer

Answer: c [Reason:] A compiler is a computer program (or set of programs) that transforms source code written in a programming language (the source language) into another computer language (the target language, often having a binary form known as object code).

5. A programmer by mistake writes multiplication instead of division, such error can be detected by a/an
a) Compiler
b) Interpreter
c) Compiler or interpreter test
d) None of the mentioned

View Answer

Answer: d [Reason:] No Logical errors can’t be detected.

6. The computer language generally translated to pseudo-code is
a) Assembly
b) Machine
c) Pascal
d) FORTRAN

View Answer

Answer: a [Reason:] An assembly language (or assembler language) is a low-level programming language for a computer, or other programmable device, in which there is a very strong (generally one-to-one) correspondence between the language and the architecture’s machine code instructions.

7. A system program that combines separately compiled modules of a program into a form suitable for execution is
a) Assembler
b) Linking Loader
c) Cross Compiler
d) None of the mentioned

View Answer

Answer: b [Reason:] A loader which combines 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.

8. In which way a macro processor for assembly language can be implemented?
a) Independent two-pass processor
b) Independent one-pass processor
c) Processor put into pass 1 of a standard two pass assembler
d) All of the mentioned

View Answer

Answer: d [Reason:] A general-purpose macro processor or general purpose preprocessor is a macro …designed for string manipulation, macro definition.

9. Resolution of externally defined symbols is performed by
a) Linker
b) Loader
c) Compiler
d) Interpreter

View Answer

Answer: a [Reason:] A linker or link editor is a computer program that takes one or more object files generated by a compiler and combines them into a single executable file, library file, or another object file.

10. A shift reduce parser carries out the actions specified within braces immediately after reducing with the corresponding rule of grammar S—-> xxW ( PRINT “1”) S—-> y { print ” 2 ” } S—-> Sz { print ” 3 ” ) What is the translation of xxxxyzz using the syntax directed translation scheme described by the above rules ?
a) 23131
b) 11233
c) 11231
d) 33211

View Answer

Answer: a [Reason:] Initially 2 is printed then 3 then 1 3 1.

Set 5

1. The symbol table implementation is based on the property of locality of reference is
a) Linear List
b) Search Tree
c) Hash table
d) Self Organization

View Answer

Answer: c [Reason:] A hash table (hash map) is a data structure used to implement an associative array. A hash table uses a hash function to compute an index into an array, from which the correct value can be found.

2. In operator precedence parsing whose precedence relations are defined
a) For all pair of non-terminals
b) For all pair of terminals
c) To delimit the handle
d) None of the mentioned

View Answer

Answer: a [Reason:] There are two important properties for these operator precedence parsers is that it does not appear on the right side of any production and no production has two adjacent no terminals.

3. LR parser are attractive because
a) It can be constructed to recognize CFG corresponding to almost all programming constructs
b) It does not backtrack
c) Both of the mentioned
d) None of the mentioned

View Answer

Answer: c [Reason:] These above mentioned are the reasons why LR parser is considered to be attractive.

4. The most powerful parser is
a) SLR
b) LALR
c) Canonical LR
d) Operator Precedence

View Answer

Answer: c [Reason:] The most powerful parser is Canonical LR.

5. Yacc Builds up
a) SLR parsing Table
b) Canonical LR parsing Table
c) LALR parsing Table
d) None of the mentioned

View Answer

Answer: c [Reason:] Yacc provides a general tool for describing the input to a computer program.

6. Object program is a
a) Program written in machine language
b) Translated into machine language
c) Translation of high-level language into machine language
d) None of the mentioned

View Answer

Answer: c [Reason:] A computer program when from the equivalent source program into machine language by the compiler or assembler.

7. ( Z,* ) be a structure, and * is defined by n * m =maximum ( n , m ) Which of the following statements is true for ( Z, * ) ?
a) ( Z,* ) is a monoid
b) ( Z,* ) is an algebraic group
c) ( Z,* ) is a group
d) None of the mentioned

View Answer

Answer: d [Reason:] It is neither a monoid nor a simple group nor algebraic group.

8. The address code involves
a) Exactly 3 address
b) At most Three address
c) No unary operators
d) None of the mentioned

View Answer

Answer: d [Reason:] In computer science, three-address is an intermediate code used by optimizing compilers to aid in the implementation of code-improving transformations.

9. An intermediate code form is
a) Post-fix Notation
b) Syntax Trees
c) Three address code
d) All of the mentioned

View Answer

Answer: d [Reason:] Intermediate code generator takes an input from its predecessor phase, semantic analyzer, in the form of an annotated syntax tree.

10. Relocating bits used by relocating loader are specified by
a) Relocation loader itself
b) Linker
c) Assembler
d) Macro Processor

View Answer

Answer: b [Reason:] A linker or link editor is a computer program that takes one or more object files generated by a compiler and combines them into a single executable file, library file, or another object file.