<!-- hamlet
<!-- copytar
examples/                                                                                              755    1107     770            0  5270667611   5717                                                                                                                                                                                                                                                                                                                                                                      examples/quad.f                                                                                        644    1107     770         2251  5270662514   7102                                                                                                                                                                                                                                                                                                                                                                      C Created:  Joe Zachary, October 19, 1992
C Modified:


C The arguments "A", "B", and "C" are the coefficients of a quadratic
C equation.  A, B, C can take on any values.  If the discriminant is
C positive, COUNT is set to 2 (since there are two solutions), and the
C solutions are assigned to RES1 and RES2.  If the discriminant is
C zero, COUNT is set to 1 (since there is only one solution), and the
C solution is assigned to RES1.  If the discriminant is negative,
C COUNT is set to 0 (since there are no real solutions).

      SUBROUTINE QUAD (A, B, C, RES1, RES2, COUNT)
      IMPLICIT NONE
      REAL A, B, C, RES1, RES2
      INTEGER COUNT

C Your code goes here

      END


C This tests out the QUAD subroutine

      PROGRAM TEST
      IMPLICIT NONE
      REAL A, B, C, ANS1, ANS2
      INTEGER NUM

      PRINT *, 'Please enter the coefficients of a quadratic equation'
      READ *, A, B, C
      CALL QUAD(A, B, C, ANS1, ANS2, NUM)

      IF (NUM .EQ. 2) THEN
        PRINT *, 'There are two roots: ', ANS1, ANS2
      ELSE IF (NUM .EQ. 1) THEN
        PRINT *, 'There is one root: ', ANS1
      ELSE
        PRINT *, 'There are no real roots'
      ENDIF

      STOP
      END
                                                                                                                                                                                                                                                                                                                                                       examples/if1.f                                                                                         644    1107     770          654  5270666473   6624                                                                                                                                                                                                                                                                                                                                                                      C Illustrates the basic IF statement

C Created:  Joe Zachary, October 19, 1992
C Modified:

      PROGRAM IFPROG
      IMPLICIT NONE
      INTEGER N

      PRINT *, 'Please enter an integer'
      READ *, N

      IF (N .GT. 0) THEN
         PRINT *, 'The number is positive'
      ENDIF

      IF (N .LT. 0) THEN
         PRINT *, 'The number is negative'
         PRINT *, 'How about that!'
      ENDIF

      STOP
      END
 RES1.  If the discriminant is negative,
C COUNT is set to 0 (since there are no reaexamples/if2.f                                                                                         644    1107     770         1017  5270667104   6627                                                                                                                                                                                                                                                                                                                                                                      C Illustrates the basic IF statement

C Created:  Joe Zachary, October 19, 1992
C Modified:

      PROGRAM IFPROG
      IMPLICIT NONE
      INTEGER N

      PRINT *, 'Please enter an integer'
      READ *, N

      IF (N .GT. 0) THEN
         PRINT *, 'The number is positive'

      ELSEIF (N .LT. 0) THEN
         PRINT *, 'The number is negative'
         PRINT *, 'How about that!'

      ELSE
         PRINT *, 'The number is zero'
         PRINT *, 'I figured that out by elimination!'

      ENDIF

      STOP
      END
      SUBROUTINE QUAD (A, B, C, RES1, RES2, COUNT)
      IMPLICIT NONE
      REAL A, B, C, RES1, RES2
      INTEGER COUNT

C Your code goes here

      END


C This tests out the QUAD subroutine

      PROGRAM TEST
      IMPLICIT NONE
      REAL A, B, C, ANS1, ANS2
      INTEGER NUM

      PRINT *, 'Please enter the coefficients of a quadratic equation'
      READ *, A, B, C
      CALL QUAD(A, B, C, ANS1, ANS2, NUM)

      IF (NUM .EQ. 2) THEN
        PRINT *, 'There are two roots: ', ANS1, A                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                