GATE CSE
First time here? Checkout the FAQ!
x
+3 votes
464 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 (39.7k points) 255 1305 1936 | 464 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 (46.9k points) 61 295 639
selected by


Quick search syntax
tags tag:apple
author user:martin
title title:apple
content content:apple
exclude -tag:apple
force match +apple
views views:100
score score:10
answers answers:2
is accepted isaccepted:true
is closed isclosed:true
Top Users Oct 2017
  1. Arjun

    23324 Points

  2. Bikram

    17048 Points

  3. Habibkhan

    7808 Points

  4. srestha

    6222 Points

  5. Debashish Deka

    5430 Points

  6. jothee

    4958 Points

  7. Sachin Mittal 1

    4772 Points

  8. joshi_nitish

    4286 Points

  9. sushmita

    3964 Points

  10. Rishi yadav

    3794 Points


Recent Badges

Popular Question iarnav
Notable Question makhdoom ghaya
Popular Question LavTheRawkstar
Avid Voter atul_21
Popular Question hem chandra joshi
100 Club nikhil_cs
Notable Question Sukannya
Notable Question Sourabh Kumar
Notable Question shikharV
Nice Comment Sachin Mittal 1
27,287 questions
35,134 answers
83,911 comments
33,223 users