Skip to main content

7.3) Multiple Lines (cont'd)


With the data as:

3.4
5.7
6.8

This can also be read by an input statement like:

open(22,file=’input.dat’)
read(22,*) a, b, c

This is how it works. The program will first search for a value to assign to a and it finds 3.4. It will continue to search on that same line for a value for b and since there are no other values it will go to the second line and will find 5.7. Lastly it will find the value of 6.8 for the variable c.