5,202 views
1 votes
1 votes
Find no of tokens in below program.

#include<stdio.h>

main()

{

   int I;

   int *pi = &I; //parent pointer

   scanf("%d",pi);

   printf("%d\n", I+5);

}

1 Answer

1 votes
1 votes
statement # of tokens
#include<stdio.h> 0(zero)
main() 3
{ 1
   int I; 3
   int *pi = &I; //parent pointer 7
 scanf("%d",pi); 7
   printf("%d\n", I+5); 9
} 1
Total 31

Related questions

6 votes
6 votes
1 answer
1
junaid ahmad asked Jan 12, 2018
1,234 views
Is this line a/*b successfully generating the token's or it give lexical error ? if it is given the lexical error then why so ?I think it will give lexical error because...
4 votes
4 votes
2 answers
2
0 votes
0 votes
1 answer
3
syncronizing asked Sep 21, 2018
5,275 views
Question:Find the number of tokens in the following C code using lexical analyzer of the compiler.
0 votes
0 votes
2 answers
4
saumya mishra asked Jun 12, 2018
2,173 views
In this question we will take n-=n1 as n=n-n1 as 5 tokens or n-=n1 as 4 tokens ????