The number of tokens in the following C statement is printf("i=%d, &i=%x",…

2015

The number of tokens in the following C statement is printf("i=%d, &i=%x", i,&i);

  1. A.

    13

  2. B.

    6

  3. C.

    10

  4. D.

    9

Attempted by 150 students.

Show answer & explanation

Correct answer: C

The C statement printf("i=%d, &i=%x", i,&i); contains exactly 10 tokens. These are the function identifier printf, opening and closing parentheses, a single string literal, two commas, two variable identifiers i, the address operator &, and the final semicolon.

A video solution is available for this question — log in and enroll to watch it.

Explore the full course: Isro