title: How do I read numbers from a file in Fortran and immediately do calculations with each numbers?
body: <p>I'm totally new to Fortran, and I'm trying to learn the language here:
  <a href="http://www.fortrantutorial.com/files-precision/index.php" rel="nofollow">http://www.fortrantutorial.com/files-precision/index.php</a>. I have some basic experience with C and Python, but not much, like introduction class and such.</p>
  
  <p>So in exercises 4.1, they ask me to input some numbers from a file, and check if these numbers are even or odd. Here is the code to input the numbers:</p>
  
  <pre><code>    program readdata
      implicit none
      !reads data from a file called mydata.txt
      real :: x,y,z
      open(10,file='mydata.txt')
              read(10,*) x,y,z
      print *,x,y,z
      end program  readdata
  </code></pre>
  
  <p>The file mydata.txt contains some random numbers. And they can check if the number is even or odd by:</p>
  
  <pre><code>   if (mod(num,2)&gt;0) then……
  </code></pre>
  
  <p>My question is that: if this file have like 10, or 1000 numbers, do I have to manually assign every single one of them? Is there any other way for me to do quick calculation with mass numbers situation like that?</p>