GATE Computer ScienceModerateGATE CSE

A C lexer uses maximal munch. How many tokens does it produce for the line int x = a++ + --b >= 3 ? 1 : 0; (whitespace is ignored)?

  1. A. 15
  2. B. 14
  3. C. 16
  4. D. 13

Correct answer: A. 15

Tokens: int, x, =, a, ++, +, --, b, >=, 3, ?, 1, :, 0, ; which is 15.

More Compiler Design questions

Exams that ask this topic