retagged by
36,422 views
41 votes
41 votes

The number of tokens in the following C statement is

printf("i=%d, &i=%x", i, &i);
  1. $3$
  2. $26$
  3. $10$
  4. $21$
retagged by

7 Answers

2 votes
2 votes
if it is  i++   in place of &i   then answer will be 10 ??
1 votes
1 votes
Number of tokens(i.e valid lexemes that matches with their pattern ) are

 1)printf   

2). (

3)"i=%d, &i=%x"

4.) ,

5) i

6) ,

7) &

8) i

9) )

10) ;

Hence ,total no of tokens =10  ,Answer C is correct.
Answer:

Related questions

24 votes
24 votes
5 answers
3