C
C                                           2
C   Program to solve quadratic equation:  ax  + bx + c
C
C               ---------
C          +   / 2
C       -b - \/ b  - 4ac
C   x = -----------------
C              2a
C
C234567**********************************************************************
C Declarations

      real  a, b, c,  x2, underradical

C Ask for initial values from user, then read what he typed

      print *, 'Type in a b and c separated by blanks, then hit RETURN'
      read  *, a, b, c

C Check if a=0  (line, not parabola)

      if ( a .EQ. 0) then
         print *, 'a is 0, this is a line'
         go to 200
      endif

C Check if irrational

      underradical = ( b**2 ) - ( 4 * a * c)
      if ( underradical .LT. 0 ) then
         print *, 'Cannot take square root, number is negative'
         go to 200
      endif

C Now go ahead and compute values

      x1 = ( -(b) - (sqrt(underradical)) )  /  ( 2 * a )
      x2 = ( -(b) + (sqrt(underradical)) )  /  ( 2 * a )

C Print results

      print *, 'The two roots are:', x1, x2
      
C And leave

200   print *, 'Exiting.  Bye.'
      end
