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