ISRO Scientist/Engineer CSE 2020Compiler Design › Not yet assigned to a topic
ISRO Scientist/Engineer CSE 2020 PYQ: The number of tokens in the following C code segment is switch(inputvalue) { case 1 : b =c*d; break; default…
The number of tokens in the following C code segment is
switch(inputvalue)
{
case 1 : b =c*d; break;
default : b =b++; break;
}- A27
- B29
- C26Correct answer
- D24
Answer
(C) $26$
Approach
Tokenize the given C code segment by identifying every keyword, identifier, constant, operator, and punctuation mark as a separate token. Count them systematically.
Reviewed by ISRO IQ Editorial Team.