in Compiler Design
4,971 views
5 votes
5 votes

The number of tokens in the FORTRAN statement DO 10 I = 1.25 is

  1. 3
  2. 4
  3. 5
  4. None of the above
in Compiler Design
5.0k views

2 Comments

A)3

there are 3 tokens because its 1.25 not 1,25 . Notice the dot and comma in those.  Answer would be 5 if it would have comma 1,25 .
1
1
what 's its right option ??
0
0

4 Answers

10 votes
10 votes
Best answer

(a) 3 is Answer , 
token1= DO10I ,

token2= '='

token3=1.25

Within the statement field, blanks were generally ignored, allowing the programmer to omit space between tokens for brevity, or include spaces within identifiers for clarity (for example, AVG OF X was a valid identifier, and equivalent to AVGOFX). 

reference @http://en.wikipedia.org/wiki/Fortran

selected by

2 Comments

@LeenSharma  and @ Mithlesh  token1= DO10I // is a special keword use in fortran ??
0
0
What does the following statement mean?

DO10I
0
0
6 votes
6 votes

5 tokens

1.DO 

2.10

3.I

4=

5.1.25

4 Comments

Are, its okay. Tum to serious hogaye :)
0
0
Why we are rejecting the fact that whitespaces are insignificant. Any specific reason please share.
0
0
But the correct ans given is 5(according to geeksforgeeks).
0
0
3 votes
3 votes
This is a fortran statement and in fortran blanks in fixed-format are ignored hence, in fortran this statement is considered as an instance of the identifier. So number of tokens will be 3 (DO5I, =,1.25).

If statement was like DO 5 I = 1,25 then it would have been considered as a DO statement.

Reference : - Dragon book, Page number 113 second edition.
by

1 comment

I dont have book. Can u please scan the page and share
0
0
1 vote
1 vote
Is it 5?

1 comment

It is 5 Tokens........
0
0

Related questions

0 votes
0 votes
0 answers
1
Kathleen asked in Programming Sep 13, 2014
312 views
Kathleen asked in Programming Sep 13, 2014
312 views