1 votes 1 votes Find the number of tokens in the following C code$:$ main() { int x = 10 , *P ; int y = x ++ ; char * q ; P = & x ; q = 'A' ; if(*P>=10) { *P = x + 100; } else { printf("%d" , x); /*comment*/ } } Compiler Design compiler-design lexical-analysis compiler-tokenization made-easy-booklet numerical-answers + – Shubham_Kr asked Apr 11, 2019 retagged Jul 8, 2022 by Lakshman Bhaiya Shubham_Kr 3.1k views answer comment Share Follow See all 0 reply Please log in or register to add a comment.
Best answer 2 votes 2 votes There $>=$ $(or)$ $\geq$ are only one token(because this is a operator in C language). Lakshman Bhaiya answered Apr 12, 2019 selected Apr 12, 2019 by Shubham_Kr Lakshman Bhaiya comment Share Follow See all 2 Comments See all 2 2 Comments reply Shubham_Kr commented Apr 12, 2019 reply Follow Share @Lakshman Patel RJIT Is *P count to one token or two? My doubt is because it is a pointer variable..can you please tell about same for 'A' it is counted one not three. 0 votes 0 votes Lakshman Bhaiya commented Apr 12, 2019 reply Follow Share $*$ is the operator and $P$ are identifier so we count $*$P as two tokens.And for $'A'$, this is the character literal so we count as one token. 3 votes 3 votes Please log in or register to add a comment.
0 votes 0 votes 58 is correct ans Anup dogrial answered Jan 8, 2020 Anup dogrial comment Share Follow See all 0 reply Please log in or register to add a comment.