in Compiler Design
1,769 views
2 votes
2 votes

What it the number of tokens in the following line?

printf("%d  numbers.", &x);

 

in Compiler Design
by
1.8k views

4 Comments

@kumar.dilip I thought quotes in the string constant are separate tokens. "|%d number.|"
0
0
Okk
0
0

Almost same question: GATE2000-1.18, ISRO2015-25

0
0

5 Answers

4 votes
4 votes

total 8 tokens

1 vote
1 vote

Correct answer is 8.

The token break-up is as follows : 

printf|(|"%d  numbers."|,| &|x|)|;|

3 Comments

Thanks!
0
0
Is this a joke or what? You copied my comment and put it as your answer
1
1
Yes,It is Copied..   I copied that printf part bcoz there is a problem in my pc. If you want to cancel it no problem..
0
0
0 votes
0 votes
ans= 8
1  printf
2  (
3 "%d  numbers." 
4 , 
5 &
6 x
7 )

8  ;

0 votes
0 votes
printf
(
"%d  numbers."
,
&
x
)
;

8 token 

Related questions