title: Fortran end of file error
body: <p>I am learning about Fortran and currently doing the exercise on fortrantutorials.com.  I have to run the following code:</p>
  
  <pre><code>program magic    
    implicit none
    real, dimension(100) :: a,b,c,d
    open(10, file='data.txt')
    read(10,*) a
    b = a*10
    c = b-a
    d = 1
    print*, 'a = ', a
    print*, 'b = ', b
    print*, 'c = ', c
    print*, 'd = ', d
  end program magic
  </code></pre>
  
  <p>It reads the following data.txt file:</p>
  
  <pre><code>24
  45
  67
  89
  12
  99
  33
  68
  37
  11
  </code></pre>
  
  <p>When I run it, it shows this error:</p>
  
  <pre><code>At line 6 of file test.f95 (unit = 10, file = 'data.txt')
  Fortran runtime error: End of file
  [Finished in 0.0s with exit code 2]
  </code></pre>
  
  <p>Line 6 refers to the following line, and I have double checked that the 'data.txt' and my fortran file are indeed in the same directory:</p>
  
  <pre><code>read(10,*) a
  </code></pre>
  
  <p>What can I do to resolve this problem? Thanks in advance. </p>