Skip to content
Related Articles

Related Articles

C | Misc | Question 7
  • Difficulty Level : Easy
  • Last Updated : 09 Feb, 2013
GeeksforGeeks - Summer Carnival Banner

The number of tokens in the following C statement is (GATE 2000)




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

(A) 3
(B) 26
(C) 10
(D) 21


Answer: (C)

Explanation: In a C source program, the basic element recognized by the compiler is the “token.” A token is source-program text that the compiler does not break down into component elements.
There are 6 types of C tokens : identifiers, keywords, constants, operators, string literals and other separators. There are total 10 tokens in the above printf statement.
Below are tokens in above program.

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


Quiz of this Question

Want to learn from the best curated videos and practice problems, check out the C Foundation Course for Basic to Advanced C.
My Personal Notes arrow_drop_up
Recommended Articles
Page :