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);
- A.
13
- B.
6
- C.
10
- 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.