Is the given answer correct?
Total 34
"printf("%d%d%d,a,b,c")"
will be considered as
"printf(" % d % d % d , a , b , c ")"
NOT as 1 token but as 14 token
srestha may be i am wrong here but i think anything come between " " is a token.Please correct me i am wrong.
Yes 34 is correct.
Tokens:
1:: int
2:: main
3,4:: ( )
5,6::{ }
7::int
8,9,10:: a,a,a
11,12,13:: b,b,b
14,15,16::c,c,c
17-24::=,,,,,;;;
25-30:: %%%ddd
31:: =
32:: +
33:: "printf("
34:: ")"
Source: http://www.personal.kent.edu/~rmuhamma/Compilers/MyCompiler/chapter3.htm
Coreect me if I'm wrong!
64.3k questions
77.9k answers
244k comments
80.0k users