program small_pgm ! Everything from here to the "end program" statement is ! a part of the main program. ! .. Implicit None Statement .. implicit none ! .. Local Scalars .. real :: n, x ! .. Executable Statements .. write (*,'(1x,a)',advance='NO') 'Number >1: ' read *, n call number_of_primes print *, 'Approximately ', x, ' primes less than', n contains subroutine number_of_primes ! .. Implicit None Statement .. implicit none ! .. Intrinsic Functions .. intrinsic LOG ! .. Executable Statements .. x = n/LOG(n) end subroutine number_of_primes end program small_pgm