C	A simple (_very_ simple) prime number checker
C	by Vince Weaver <vince@deater.net>.
*	This is meant more to check my f77 plotter than to
C	Be mathematically or computationally efficient.
C	URGH it's like BASIC all over again
      
      PROGRAM FIND_PRIMES

      INTEGER CHECK,X,PRIME

      PRINT *,"VINCE WEAVERS PRIME NUMBER FINDER"
      GOTO 10
 30   WRITE (*,*)
      GOTO 40
 10   GOTO 30
 40   DO 100, I=1,20
        PRIME=1
        J=0
        WRITE (*,*) "ENTER NUMBER TO CHECK IF PRIME, 0 to QUIT"

        READ (*,*, END=500) CHECK

        IF (CHECK) 600,600,50
 50     DO 70, X=2,(CHECK/2)
          IF (((CHECK/X)*X) .EQ. CHECK) THEN
            PRIME=0
            WRITE (*,55) CHECK,' IS DIVISIBLE BY ',X
          ELSE
            J=J+1
 
          ENDIF
70    CONTINUE
      IF (PRIME .EQ. 1) WRITE (*,*) CHECK,' IS PRIME'


   55     FORMAT (I4,A20,I4)
 100   CONTINUE
      GOTO 600

 500  STOP "ABNORMAL END"
 600  WRITE (*,*) 'THANK YOU FOR USING THIS PROGRAM.  ',
     &  'WE HERE AT VMW FORTRAN INDUSTRIES APPRECIATE YOUR BUSINESS.'
      END
