Consider the following C program:
int main (void) { in/*this is an example*/z; double/*is it an error?*/y; print( “This is simple” ); return 0; }
- How many Different tokens are there in the above code.
int main ( void ) { in z ; double y ; print( “This is simple” ); return 0 ; }
All Colored ones are different Tokens = 16
Types of tokens-
keywords - int, void , double, return.
Identifiers - main , in, z, y, print.
Strings - “This is simple”.
Constant - 0.
Special- symbols / Delimiter / Punctuator / - ( , ), ; , { , } , comma.
NOTE:
( 6 types of c tokens )
64.3k questions
77.9k answers
244k comments
80.0k users