Q. 14. Write which of the following varible names
are invalid in FORTRAN?
(i) STOP (June 2001, Dec. 99)
(ii) ROOTZ (June 2001, June
2000, Dec. 99)
(iii) 2RATES (June 2001)
(iv) ROLL2 (Dec. 2001)
(v) PROGRAM (Dec. 2001)
(vi) X + Y (Jan. 2001)
(vii) END (Jan. 2001, June
2000)
(viii) 2ROOT (Jan. 2001)
(ix) Y - 55 (June 2000)
(x) M + 30 (Dec. 99)
Ans. (i) Invalid variable because the keyword
of Fortran cannot be used as variable name.
Ans. (ii) Valid variable.
Ans. (iii) Invalid variable because first character
must be alphabetic.
Ans. (iv) Valid variable.
Ans. (v) Valid variable.
Ans. (vi) Invalid variable as '+' sign cannot
be allowed in the variable name.
Ans. (vii) Invalid variable because the keyword
of Fortran cannot be used as variable name.
Ans. (viii) Invalid variable because first
character must be alphabetic.
Ans. (ix) Invalid variable as '-' sign cannot
be allowed in the variable name.
Ans. (x) Invalid variable as '+' sign cannot
be allowed in the variable name.
|