Compiler Design | NPTEL | Week 3 Assignment Solutions

This set of MCQ(multiple choice questions) focuses on the Compiler Design NPTEL 2023 Week 3 Assignment Solutions.

Course layout

Answers COMING SOON! Kindly Wait!

Week 1: Assignment answers
Week 2: Assignment answers
Week 3: Assignment answers
Week 4: Assignment answers
Week 5: Assignment answers
Week 6: Assignment answers
Week 7: Assignment answers
Week 8: Assignment answers
Week 9: Assignment answers
Week 10: Assignment answers
Week 11: Assignment answers
Week 12: Assignment answers

NOTE: You can check your answer immediately by clicking show answer button. This set of “Compiler Design NPTEL 2023 Week 3 Assignment Solution” contains 10 questions.

Now, start attempting the quiz.

Compiler Design NPTEL 2023 Week 3 Assignment Solutions

Q1. At a time, a DFA can be in

a) Many states
b) No state
c) Only a single state
d) None of the other options

Answer: c)

Q2. Between NFA and DFA which an has the potential to have more states in it?

a) NFA
b) DFA
c) Cannot be said deterministically
d) Both have same number of states

Answer: b)

Q3. E-closure of a state includes

a) All states reachable from it by E transitions only
b) All states reachable from it by single E transitions only
c) All states from which this state can be reached using E transitions
d) All states from which this state can be reached using E transitions and all states reachable from it by E transitions only

Answer: a)

Compiler Design NPTEL week 3 Assignment Solutions

Q4. Lex specification file sections are demarcated by

a) %
b) {%
c) %}
d) %%

Answer: d)

Compiler Design NPTEL week 3 Assignment Solutions

Q5. Which is the tool for parser generator?

a) yacc
b) bison
c) flex
d) yacc and bison

Answer: d)

Q6. Among Type-0, Type-1 and Type-3 grammar which one is the most flexible and popular grammar?

a) Type-0 grammar
b) Type-1 grammar
c) Type-2 grammar
d) Type-3 grammar

Answer: a)

Q7. Number of components in formal definition of a grammar is

a) 2
b) 3
c) 4
d) None of the other options

Answer: c)

Q8. Number of sections in a lex program is

a) 4
b) 3
c) 2
d) 1

Answer: b)

Compiler Design NPTEL week 3 Assignment Solutions

Q9. Which phase of the compiler is Syntax Analysis?

a) First
b) Second
c) Third
d) None of the mentioned

Answer: b)

Q10. Binary string in which 1 is always followed by at least a single 0 is

a) 101
b) 1*01*
c) 0*(100*)
d) 0*1

Answer: c)

Q11. All the regular languages can have one or more of the following descriptions:
i) DFA
ii) NFA
iii) Regular Expressions
Which of the following are correct?

a) i only
b) ii, iii
c) i, ii
d) iii only

Answer: b)

Q12. Which of the following is a lexical analysis tool?

a) lex
b) flex
c) jflex
d) All of the other options

Answer: d)

Compiler Design NPTEL week 3 Assignment Solutions

Q13. In a lex specification file “?” stands for

a) 0 or more occurrences of preceding regular expression
b) One or more occurrence of preceding regular expression
c) Exactly one occurrence of preceding regular expression
d) None of the other options

Answer: d)

Q14. Which type of grammar is the context free grammar?

a) Type-1 grammar
b) Type-2 grammar
c) Type-3 grammar
d) Type-0 grammar

Answer: b)

<< Prev- Compiler Design Week 2 Assignment Solutions

>> Next- Compiler Design Week 4 Assignment Solutions


NPTEL answers: Problem solving through programming in C

Programming in Java NPTEL week 1 quiz answers

NPTEL – Python for Data Science assignment solutions

Nptel – Deep Learning assignment solutions

For discussion about any question, join the below comment section. And get the solution of your query. Also, try to share your thoughts about the topics covered in this particular quiz.

Leave a Comment

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