      PROGRAM CQUAD
**********************************************************************
* Program to solve a quadratic equation having complex coefficients: *
* using the quadratic formula.  Variables used are:                  *
*    A, B, C : the coefficients of the quadratic equation            *
*    DISC    : the discriminant, B ** 2 - 4 * A * C                  *
*    ROOT1, ROOT2 : the two roots of the equation                    *
*                                                                    *
* Input:  A, B, and C                                                *
* Output: ROOT1 and ROOT2                                            *
**********************************************************************

      COMPLEX A, B, C, DISC, ROOT1, ROOT2

      PRINT *, 'ENTER THE COEFFICIENTS OF THE QUADRATIC EQUATION'
      READ *, A, B, C
      DISC = SQRT(B ** 2 - 4.0 * A * C)
      ROOT1 = (-B + DISC) / (2.0 * A)
      ROOT2 = (-B - DISC) / (2.0 * A)
      PRINT *, 'THE ROOTS ARE:'
      PRINT 10, ROOT1, ROOT2
10    FORMAT (5X, F7.3, ' +', F7.3, 'I')
      END

