adplus-dvertising
frame-decoration

Question

A CFG for a program describing strings of letters with the word “main” somewhere in the string:

a.


-> m a i n
-> | epsilon
-> A | B | … | Z | a | b … | z

b.


–> m a i n
–>
–> A | B | … | Z | a | b … | z

c.


–> m a i n
–> | epsilon
–> A | B | … | Z | a | b … | z

d.

None of the mentioned

Answer: (a).
-> m a i n
-> | epsilon
-> A | B | … | Z | a | b … | z

Engage with the Community - Add Your Comment

Confused About the Answer? Ask for Details Here.

Know the Explanation? Add it Here.

Q. A CFG for a program describing strings of letters with the word “main” somewhere in the string: