<html>
  <head>

    <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  </head>
  <body>
    <p>For those of you that are still struggling with getting the
      in-class Fortran code assignment done, I have included a working
      piece of code that should closely resemble what I gave you for
      python.  Please look over this and make sure you understand what
      is going on.   You may use this for your assignment - but if you
      do please acknowledge in the code that you are doing that.</p>
    <p><font face="monospace">program primes<br>
            integer :: num1, num2<br>
            print *, "What is the first number?"<br>
            read *, num1<br>
            print *, "What is the second number?"<br>
            read *, num2<br>
            call printPrimes(num1, num2)<br>
        end program primes<br>
        <br>
        subroutine printPrimes(num1, num2)<br>
                integer :: num1, num2<br>
                interface<br>
                    logical function isPrime(checknum)<br>
                            integer :: checknum<br>
                    end function isPrime<br>
                end interface<br>
                do i = num1, num2<br>
                    if ( isPrime(i) ) print *, i<br>
                enddo<br>
        end subroutine printPrimes<br>
        <br>
        logical function isPrime(check)<br>
                integer :: check, numDivisors<br>
                numDivisors = 0<br>
                do i = 1, check<br>
                    if ( mod(check,i) .eq. 0 ) numDivisors = numDivisors
        + 1<br>
                enddo<br>
                isPrime = numDivisors == 2<br>
                return<br>
        end function isPrime<br>
      </font><br>
    </p>
    <div class="moz-signature">-- <br>
      <b>Andrew J. Pounds, Ph.D.</b><br>
      <i>Professor of Chemistry and Computer Science</i><br>
      <i>Director of the Computational Science Program</i><br>
      <i>Mercer University, Macon, GA, 31207 (478) 301-5627 </i></div>
  </body>
</html>