Listed-Directed Input: The READ Statement


List-directed input is carried out with the Fortran READ statements. The READ statement can read input values into a set of variables from the keyboard.

The READ statement has the following forms:

READ(*,*)  var1, var2, ..., varn
READ(*,*)

The first form starts with READ(*,*), followed by a list of variable names, separated by commas. The computer will read values from the keyboard successively and puts the value into the variables. The second form only has READ(*,*), which has a special meaning.

Preparing Input Data:

Preparing input data is simple. Here are the rules: