The C language is:

2002

The C language is:

  1. A.

    A context-free language

  2. B.

    A context-sensitive language

  3. C.

    A regular language

  4. D.

    Fully parsable only by a Turing machine

Attempted by 7 students.

Show answer & explanation

Correct answer: B

The correct answer is Option B. The grammar used for the syntactic structure of C is largely context-free, but the complete language of valid C programs also includes context-dependent restrictions. For example, an identifier must be declared before use and its use must be compatible with its declared type. Such requirements cannot be captured by a regular language or by a simple context-free grammar alone; in the Chomsky hierarchy this makes the full C language context-sensitive.

Explore the full course: Gate Guidance By Sanchit Sir