! quadr - program that calculates the quadratic formula
! Originally from ....
!  altered to remove subroutine 1/26/2007

!program quadr
!
!  call quad(1.,3.,5.)
!  call quad(1.,2.,1.)
!  call quad(1.,2.,10.)

!endprogram quadr


PROGRAM quadra
  REAL :: a , b , c , x1 , x2 , test , disc    
  PRINT *,'Please input as comma separated floating point numbers'
  PRINT *,'the three coefficients from the quadratic forumula.'
  READ(*,*) a,b,c

  test = b*b - 4.0*a*c
  IF (test < 0.0) THEN
     PRINT * , ' Complex Roots'
  ELSE
     disc = SQRT(test)
  ENDIF
  x1 = -(b + SIGN(disc,b)) / (2.0*a)
  x2 =  c/x1
  PRINT * , ' Roots', x1, x2
  RETURN

END PROGRAM 

