The number of tokens in the following C statement is printf("i = %d, &i = %x",…
2000
The number of tokens in the following C statement is
printf("i = %d, &i = %x", i, &i);
- A.
3
- B.
26
- C.
10
- D.
21
Attempted by 88 students.
Show answer & explanation
Correct answer: C
In C, tokens are the smallest meaningful units. The statement printf("i = %d, &i = %x", i, &i); contains: 1. printf, 2. (, 3. "i = %d, &i = %x", 4. ,, 5. i, 6. ,, 7. &, 8. i, 9. ), and 10. ;. This totals exactly ten tokens.
A video solution is available for this question — log in and enroll to watch it.