Compiler Mcqs (Org)
Compiler Mcqs (Org)
Compiler Mcqs (Org)
Q2 If conversion from one type to another type is done automatically by the compiler then,it is called
a. Implicit conversion
b. Coercions
C c. both a and b
d None of the above
a. Hardware
B b. Compiler
c. Registers
d None of the above
a. Dominators
b. Reducible graphs
c. Depth first ordering
D d All of these
Q11. The lexical analyzer takes _________ as input and produces a stream of _______ as output.
a. Lexical analyzer
b. Syntax analyzer
C c. Semantic analyzer
d Error handling
Q13 A grammar is meaningless
A a. Linker
b. Loader
c. Compiler
d Assembler
Q16. Which of the following is used for grouping of characters into tokens?
a. Parser
b. Code optimization
c. Code generator
D d Lexical analyzer
a. Source language
b. Target language
C c. Compiler
d All of these
a. Source language
b. Target language
C c. Compiler
d All of these
a. Exactly 3 address
b. At most 3 address
c. No unary operators
D d None of these
Q22 A compiler is
a. Always be evaluated
b. Be evaluated only if the definition is L –attributed
C c. Be evaluated only if the definition has synthesized attributes
d None of the above
Q24 Which of the following actions an operator precedence parser may take to recover from an error
Q27. The graph that shows basic blocks and their successor relationship is called
a. DAG
B b. Flow chart
c. Control graph
d Hamiltonian graph
Q28. Generation of intermediate code based on a abstract machine model is useful in compilers
because
a. It is simple to implement
b. It never gets into an infinite loop
c. Both A and B
D d None of these
a. Postfix notation
b. Syntax trees
c. Three address code
D d All of these
Q35. A compiler for a high level language that runs on one machine and produce code for different
machine is called
a. Optimizing compiler
b. One pass compiler
C c. Cross Compiler
d Multipacks compiler
Q36. Which of the following is used for grouping of characters into tokens (in a computer)
a. A parser
b. Code optimizer
c. Code generator
D d Scanner
Q37. Local and loop optimization in turn provide motivation for
A a. Data flow analysis
b. Constant folding
c. Pee hole optimization
d DFA and constant folding
Q38. A simple two-pass assembler does which of the following the first phase
a. Application software
B b. A system software
c. A hardware component
d All of the above
a. SLR
b. LALR
C c. Canonical LR
d Operator precedence
A a. Assembler
b. Compilers
c. Interpreters
d All of these
a. LL grammar
b. Ambiguous grammar
C c. LR grammar
d None of the above
Q44. A compiler that runs on one machine and produces code for a different machine is called
A a. Cross compilation
b. Two pass compilation
c. One pass compilation
d None of the above
Q45. _________or scanning is the process where the stream of characters making up the source
program is read from left to right and grouped into tokens.
A a. Lexical analysis
b. Diversion
c. Modeling
d None of the above
a. Source code
B b. Intermediate code
c. Target code
d All of the above
Q47. In analysis the compilation PL/I program the description Create of more optimal matrix is
associated with
a. Assembly and output
b. code generation
c. Syntax analysis
D d machine independent optimization
A a. re-allocation
b. Allocation
c. Linking
d Loading
a. Exactly 3 address
b. At most 3 address
c. No unary operators
D d None of these
a. Postfix notation
b. Syntax trees
c. Three address code
D d All of these
Q55. A compiler for a high level language that runs on one machine and produce code for different
machine is called
a. Optimizing compiler
b. One pass compiler
C c. Cross compiler
d Multitasks compiler
Q56. Synthesized attribute can be easily simulated by
a. LL grammar
b. Ambiguous grammar
C c. LR grammar
d None of the above
a. Machine code
b. Intermediate code
C c. A stream of tokens
d A parse tree
Q58. If conversion from one type to another type is done automatically by the compiler then, it is
called
a. Implicit conversion
b. Coercions
C c. both a and b
d None of the above
a. Hardware
B b. Compiler
c. Registers
d None of the above
A a. Dominators
b. Reducible graphs
c. Depth first ordering
d All of these
a. Compiler
b. Interpreter
C c. Assembler
d Linker
a. ALU
b. Registers
c. CU
D d All of the above
a. John Atansof
b. Mari can E Huff
c. Joseph Jacquard
D d All contribute to invent the microprocessor
a. Intel2004
b. Intel3004
C c. Intel4004
d Intel8004
a. 1983
b. 1984
C c. 1985
d 1983
Q73. The fourth generation computers came with the advent of the?
A a. Microprocessor Chip
b. electronic chips
c. semi-conductors
d Transistor
Q74. A computer program that converts the whole program into machine language at a single time is
called?
a. Interpreter
B b. Compiler
c. Translator
d All of the above
Q75. A computer program that converts the program into machine language line by line is called?
A a. Interpreter
b. Compiler
c. Translator
d All of the above
Q76. Compiler is a?
a. Program
b. Software
C c. Translator
d None of the above
a. Make computers
b. Make calculators
c. Make digital system
D d All of the above
Q78. In a microprocessor there are 120 instructions, how many bits needed to implement this?
a. 6
B b. 7
c. 8
d 9
a. 1980
b. 1981
C c. 1982
d 1983
Q81. Which device can understand the difference data and programs?
a. Motherboard
B b. Microprocessor
c. ALU
d Registers
a. Logical Error
B b. Syntax Error
c. Both Logical and Syntax Error
d Not Logical and Syntax Error
a. Transistor
b. Vacuum tubes
c. Chips
D d microprocessor chips
Q85. A co-processor?
a. few processes
B b. specific functions
c. Both
d None
a. Syntax analysis
b. Intermediate code generation
c. Lexical analysis
D d All of the above
Q88. A system program that combines the separately compiled modules of a program into a form
suitable for execution?
a. Assembler
b. Compiler
C c. Linking loader
d Interpreter
Q90. The number of clock cycles necessary to complete 1 fetch cycle in 8085 is?
a. 3 or 4
b. 4 or 5
C c. 4 or 6
d 6 or 7
Q91. Which of the following electronic component are not found in ordinary ICs?
a. Diodes
b. Transistors
c. Resistors
D d Inductors
a. 8 Bit
b. 16 Bit
c. 32 Bit
D d 64 Bit
a. 4 Bit
b. 8Bit
C c. 16 Bit
d 32Bit
Q94. Intel 486 is___ bit microprocessor?
a. 8 Bit
b. 16 Bit
C c. 32 Bit
d 64 Bit
a. binary code
b. machine code
C c. Both
d None
Q97. In a microprocessor there are 120 instructions, how many bits needed to implement this?
a. 6
B b. 7
c. 8
d 9
a. PROM
b. RAM
c. Cache memory
D d EEPROM
Q100. Parser takes tokens from scanner and tries to generate _______________ .
Q101. Flex is an automated tool that is used to get the minimized DFA (scanner).
a.
True
B b. False
A a. h
b. g, h, i, $
c. g, i
d G
A a. g, h, i, $
b. g, h, $
c. h, i, $
d h, g, $
A a. Input
b. Output
c. Input and Output
d None of the given
Q105. Typical compilation means programs written in high-level languages to low-level ____________.
a. Object code
b. Byte code
c. Unicode
D d Both Object Code and byte code
Q107. In DFA minimization we construct one _______________ for each group of states from the initial
DFA.
A a. State
b. NFA
c. PDA
d None of given
Q108. Flex is an automated tool that is used to get the minimized DFA (scanner).
a. True
B b. False
Q112. In multi pass compiler during the first pass it gathers information about ______________
A a. Declaration
b. Bindings
c. Static information
d None of the given
Q113. ______________ phase which supports macro substitution and conditional compilation.
a. Semantic
b. Syntax
C c. Preprocessing
d None of given
Q120. A compiler for a high level language that runs on one machine and produce code for different
machine is called
A a. Optimizing compiler
b. One pass compiler
c. Cross compiler
d Multiples compiler
Q125. or scanning is the process where the stream of characters making up the source program is
read from left to right and grouped into tokens.
a. Lexical analysis
b. Diversion
c. Modeling
D d None of the above
Q126.
Task of the lexical analysis
Q127. Typical compilation means programs written in high-level languages to low-level ____________.
a. Object code
b. Byte code
c. Unicode
D d Both Object Code and byte code
a. Insertion alone
b. Deletion alone
a. is similar to interpreter
A a. Ambiguous
b. Unambiguous
c. Regular
d None of these
Q131. A grammar that produces more than one parse tree for some sentence is called
A a.
Ambiguous
b. Unambiguous
c. Regular
d None of these
A a. re-allocation
b. Allocation
c. Linking
d Loading
b. Common subprograms
D Loop declaration
Q134.
Code can be optimized at
c. Intermediate code
a. Lexical analyzer
b. Syntax analyzer
C c. Semantic analyzer
D Error handling
a. Lexical analysis
b. Syntax analysis
D Code optimization
a. A device
b. Timer
c. Scheduler
D d Power failure
Q140. Which of the following can be accessed by transfer vector approach of linking?
B b. External subroutines
d All of these
a. Re-allocation
b. Allocation
c. Linking
D d Loading
C c. It is easy to modify
d All of these
A a. Loop unrolling
b. Loop jamming
c. Constant folding
d None of these
a. Operator precedence
B b. Canonical LR
c. LALR
d SLR
Q146 Inherited attribute is a natural choice in
c. Both A and B
d None of these
a. Hardware
b. Compiler
c. Registers
d None of the above
D b. Reducible graphs
d All of these
a. Postfix notation
b. Syntax trees
Q150. The action of parsing the source program into proper syntactic classes is called
a. Syntax analysis
B b. Lexical analysis
c. Interpretation analysis
A a. create the expanded source code file sanfoudry.i for the source
code file sanfoundry.c
b. append the content of the sanfoundry.c into sanfoundry.i
c. give an error
Q153. Which option of gcc makes the compiler print out each function name as it is compiled, and print
some statistics about each pass when it finishes?
a. -P
b. -P
c. -q
D d -Q
Q156. Pipes are used rather than temporary files for communication between the various stages of
compilation in gcc when
A a. -pipe option is used
Q157. The gcc option -Wunused warns when a _____ variable is unused aside from its declaration.
A a. variable
b. function
c. macro
Q159. The command line options of gcc can also be read from a file with.
a. @
b. $
C c. #
d none of the mentioned
Q160. Which option of the gcc is used to warn is padding is included in structure?
A a. Wpadded
b. Wpad
c. Wpadding
Q161. Which gcc option reports the cpu time taken by each subprocess in the compilation sequence?
A a. time
b. cpu
c. process
c. Recursive language
d None of these
Q163 Which gcc option reports the cpu time taken by each subprocess in the compilation sequence?
A a. time
b. cpu
c. process
A a. A → BC or A → A
b. A → BC or A → a
c. A → BCa or B → b
d None of these
Q168. While converting the context free grammar into Greibach normal form, which of the following is
not necessary
a. Elimination of null production
b. Elimination of unit production
c. Converting given grammar in Chomsky normal form
D d None of these
Q169. The context free grammar S → A111|S1, A → A0 | 00 is equivalent to
A 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
Q173. The preprocessor removes the _______ from the source code.
a. Comments
B b. header files
c. both (a) and (b)
d none of the mentioned
Q181. Typical compilation means programs written in high-level languages to low-level ____________.
a. Object code
b. Byte code
c. Unicode
D d Both Object Code and byte code
Q185. If we do not specify the executable file name at the compilation time in GCC, then in linux the
compiler creates executable named as
A a. a.out
b. a.exe
c. x.out
d x.exe
Q194. Which one of the following command can be used to provide executable permissions for a file?
a. chmod +x
b. chmod 777
C c. both (a) and (b)
d none of the mentioned
Q196. The lines in our code that begin with the “#” character are
A a. preprocessor directives
b. macros
c. header files
d none of the mentioned
Q197. Command line parameters are passed by the
a. Preprocessor
b. Assembler
c. Compiler
D d Linker
Q198. Which compilation step makes sure that all the undefined symbols in the code are resolved.
A a. linking
b. compiling
c. preprocessing
d none of the mentioned