The Gateway to Computer Science Excellence
First time here? Checkout the FAQ!
+2 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



asked in Compiler Design by Veteran (69k points) | 722 views

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 .
what 's its right option ??

4 Answers

+4 votes
Best answer

5 tokens






answered by Veteran (40k points)
selected by
No , It has 3 Tokens. And this problem was the cause of failure for Venus Probe Mariner 1 sent by NASA
Ohkay, someone downvoted my comment. But correct answer is still 3. (And if you become an engineer with answer 5 and somhow get into NASA later, then you might cause world's most expensive period(.) ).

Do read the
@Tusher Shinde I didn't down vote your comment.
Are, its okay. Tum to serious hogaye :)
Why we are rejecting the fact that whitespaces are insignificant. Any specific reason please share.
+2 votes

(a) 3 is Answer , 
token1= DO10I ,

token2= '='


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 @

answered by Boss (5.9k points)
reshown by
@LeenSharma  and @ Mithlesh  token1= DO10I // is a special keword use in fortran ??
+1 vote
Is it 5?
answered by Active (1.6k points)
It is 5 Tokens........
0 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.
answered by Junior (855 points)

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

33,705 questions
40,253 answers
38,862 users