The Gateway to Computer Science Excellence
+1 vote
229 views

What it the number of tokens in the following line?

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

 

in Compiler Design by Active (1.3k points) | 229 views
+3
Total no of tokens  : $8$
0
Thanks @saxena0612
+2

Yes 8 is correct. The token break-up is as follows : 

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

A " | " has been placed after every token 

0
Thank you that is very helpful @Sayan!
0
Where you were facing problem ???
0
@kumar.dilip I thought quotes in the string constant are separate tokens. "|%d number.|"
0
Okk

3 Answers

+2 votes

total 8 tokens

by Active (1.7k points)
+1 vote

Correct answer is 8.

The token break-up is as follows : 

printf|(|"%d  numbers."|,| &|x|)|;|
by Active (1.7k points)
0
Thanks!
+1
Is this a joke or what? You copied my comment and put it as your answer
0
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 votes
ans= 8
1  printf
2  (
3 "%d  numbers." 
4 , 
5 &
6 x
7 )

8  ;

by (141 points)

Related questions

Quick search syntax
tags tag:apple
author user:martin
title title:apple
content content:apple
exclude -tag:apple
force match +apple
views views:100
score score:10
answers answers:2
is accepted isaccepted:true
is closed isclosed:true
50,645 questions
56,601 answers
195,856 comments
102,230 users