GATE CSE
First time here? Checkout the FAQ!
x
+3 votes
273 views

How many tokens will be generated by the scanner for the following statement ?

$x = x ∗ (a + b) - 5$;

  1. $12$
  2. $11$
  3. $10$
  4. $07$ 
asked in Compiler Design by Veteran (30k points)   | 273 views

1 Answer

+8 votes
Best answer

ans is A)   12 

x=x*(a+b)-5;

every character is token here

token no   character

1                  x

2                  =

3                  x

4                  *

5                 (      

6                  a

7                 +

8                 b

9                  ) 

10                -

11               5

12                ;

answered by Veteran (43.9k points)  
selected by


Top Users Jun 2017
  1. Bikram

    3704 Points

  2. Arnab Bhadra

    1502 Points

  3. Hemant Parihar

    1502 Points

  4. Niraj Singh 2

    1481 Points

  5. junaid ahmad

    1432 Points

  6. Debashish Deka

    1384 Points

  7. Rupendra Choudhary

    1220 Points

  8. rahul sharma 5

    1220 Points

  9. Arjun

    1158 Points

  10. srestha

    1006 Points

Monthly Topper: Rs. 500 gift card
Top Users 2017 Jun 26 - Jul 02
  1. Arjun

    198 Points

  2. akankshadewangan24

    152 Points

  3. Debashish Deka

    138 Points

  4. Hira Thakur

    130 Points

  5. Soumya29

    104 Points


23,399 questions
30,111 answers
67,489 comments
28,424 users