The variables in Fortran is declared by using the type statement at the beginning of the program. The syntax for declaring a variable is:-

type-specifier :: list

Here type-specifier can be: -INTEGER, REAL, COMPLEX, LOGICAL AND CHARACTER and the list is the name of the variables that can be separated with commas

For example:-
  • INTEGER:: Total, Mean
  • REAL:: Average
  • CHARACTER(10) :: Surname, Name
    ((10 is the length value that must be there with the CHARACTER specifier. CHARACTER specifier can hold the string not more than 10 characters))
BY Best Interview Question ON 03 Mar 2019