The number of tokens in the following ‘C’ language statement is: printf("The…

2017

The number of tokens in the following ‘C’ language statement is:

printf("The number of tokens are %d", &tcount);

  1. A.

    8

  2. B.

    9

  3. C.

    10

  4. D.

    11

Attempted by 138 students.

Show answer & explanation

Correct answer: A

In C, a token is the smallest individual unit. The statement printf("The number of tokens are %d", &tcount); is broken into 8 tokens:

  1. printf (Identifier)

  2. ( (Delimiter)

  3. "The number of tokens are %d" (String Literal)

  4. , (Delimiter)

  5. & (Operator)

  6. tcount (Identifier)

  7. ) (Delimiter)

  8. ; (Delimiter)

Hence, the correct option is A.

Explore the full course: Niacl Ao It Specialist