Eric Postpischil's First Program

Here is my first program, with some improvements from my father. It is a FORTRAN program to print prime numbers. This version is dated July 22, 1975. I must have written the first version a few days earlier. My style and skill have changed somewhat since this was written. Here are more recent examples of my work.

Compiling and running this program to print 50 prime numbers took 4.5 CPU seconds with a "wall clock" time of 77 seconds, for a nominal charge of $1.50.

       INTEGER PRIME
       READ (5,3) N
3      FORMAT (I10)
       PRIME=1
      DO 1 I=1, N
7      IF (PRIME .GE. 2 147 483 647) GO TO 999
       PRIME= PRIME+ 1
       J = IFIX( SQRT( FLOAT (PRIME))+ 0.999 )
       J = MINO( J, PRIME-1)
       IF (J .LT. 2) GOTO 7
      DO 6 K= 2, J
       IF ((PRIME - (( PRIME/ K )* K)) .EQ. 0) GO TO 7
6     CONTINUE
       WRITE (6, 14) PRIME
1     CONTINUE
14     FORMAT (1X, I10)
999    STOP
       END

Copyright 1975 by Eric Postpischil.