Explore topic-wise MCQs in Compilers.

This section includes 8 Mcqs, each offering curated multiple-choice questions to sharpen your Compilers knowledge and support exam preparation. Choose a topic below to get started.

1.

The production of the form no terminal → Λ is said to be null production.

A. False
B. True
Answer» C.
2.

If R is regular language and Q is any language (regular/ non regular), then Pref (Q in R) is _____________

A. Non-regular
B. Equal
C. Infinite
D. Regular
Answer» E.
3.

Consider the production of the grammar S->AA A->aa A->bb Describe the language specified by the production grammar.

A. L = {aaaa,aabb,bbaa,bbbb}
B. L = {abab,abaa,aaab,baaa}
C. L = {aaab,baba,bbaa,bbbb}
D. L = {aaaa,abab,bbaa,aaab}
Answer» B. L = {abab,abaa,aaab,baaa}
4.

String generated by following expression is?

A. aabccd
B. adabcca
C. abcca
D. abababdView Answer
Answer» B. adabcca
5.

Which of the following is NOT the set of regular expression R = (ab + abb)* bbab?

A. ababbbbab
B. * bbab?a) ababbbbabb) abbbab
C. ababbabbbab
D. abababab
Answer» E.
6.

The regular expression with all strings of 0′s and 1′s with at least two consecutive 0′s is?

A. 1 + (10)*
B. (0+1)*00(0+1)*
C. (0+1)*011
D. 0*1*2*
Answer» C. (0+1)*011
7.

The regular expression have all strings of 0′s and 1′s with no two consecutive 0′s is?

A. (0+1)
B. (0+1)*
C. (0+∈) (1+10)*
D. (0+1)* 011
Answer» D. (0+1)* 011
8.

The RE in which any number of 0′s is followed by any number of 1′s followed by any number of 2′s is?

A. (0+1+2)*
B. 0*1*2*
C. 0* + 1 + 2
D. (0+1)*2*
Answer» C. 0* + 1 + 2