1.

Which of the following is an real-world programming language ambiguity?(a) dangling else problem(b) halting problem(c) maze problem(d) none of the mentionedThis question was posed to me in class test.I'd like to ask this question from Ambiguous Grammar in section Context Free Grammars and Languages of Automata Theory

Answer»

The correct answer is (a) dangling else PROBLEM

The explanation is: Dangling else problem: In many LANGUAGES,the else in an if-then-else STATEMENT is optional, which RESULTS into nested conditionals being ambiguous, at least in TERMS of the CFG.



Discussion

No Comment Found

Related InterviewSolutions