GATE CS 2026, set 2 · Question 29 · Theory of Computation · Multiple select (MSQ) · 1 mark · no negative marks

Which of the following grammars is/are ambiguous?

  1. (A) S → aSb | ε
  2. (B) E → E + E | E * E | id
  3. (C) S → aS | Sa | ε
  4. (D) S → aS | ε
Answer

Answer (B), (C)

Answer from the official GATE CS 2026 answer key.

The step-by-step solution, where available, is part of GATE CS Pro. See what Pro includes