! Solution 8/1
   program qroots        ! Solution of quadratic equation.
!
      real :: a, b, c, d, x1, x2
!
      read(unit=*, fmt=*) a, b, c
      write(unit=*, fmt=*) " a = ", a, "b = ", b, "c = ", c
      if (a == 0.0) then
         if (b /= 0.0) then
            write(unit=*, fmt=*) " Linear: x = ", -c/b
         else
            write(unit=*, fmt=*) " No roots!"
         endif
      else
         d = b**2 - 4.0*a*c
         if (d < 0.0) then
            write (unit=*, fmt=*) " Complex", -b/(2.0*a),   &
            "+-", sqrt(-d)/(2.0*a)
         else
            x1 = -(b + sign(sqrt(d), b))/(2.0*a)
            x2 = c/(x1*a)
            write(unit=*, fmt=*) " Real roots", x1, x2
         endif
      endif
   end program qroots
