edited by
589 views
5 votes
5 votes

Consider the $C$ program given below:

#include <stdio.h>
main ()
{
    printf("This is GO mock exam\n" );
}

The total number of tokens generated when this program is passed to lexical analyzer is :______.

edited by

1 Answer

Best answer
8 votes
8 votes

#include<stdio.h> is not a token, macro expansion and file inclusion are done in preprocessing stage before giving the code to compiler for lexical analysis

1 main

2 (

3 )

4 {

5 printf

6 (

7 "This is GO mock exam\n"

8 )

9 ;

10 }

Total Token =10

Let me know it is correct or not.

Thanks  @ joshi_nitish for clearing the doubt.

selected by
Answer:

Related questions

3 votes
3 votes
3 answers
4
Bikram asked May 14, 2017
469 views
A student reaches school 15 minutes early by running at a speed of 5 km/h from his house. By walking at 3 km/h, he is late by 9 minutes. The distance between the school a...