-3

I've been solving question for GATE exams. I don't know about how to count tokens. I referred in many books and online. but couldn't find the answer.

please tell, how many tokens are present in the following program?

printf("i = %d, &i = %x", i, &i);

thanks in advance.

phuclv
  • 32,499
  • 12
  • 130
  • 417

1 Answers1

0

The tokens are atomic units that are present in annex A of ISO 9899 and they are created by the lexer.

Folllow the Backus-Naur form from the annex A to see how many tokens there are and what types they have. All the best ;)

alinsoar
  • 14,813
  • 4
  • 53
  • 68