SOURCE FILE: quadrat01.cpp



/*
    This is a program to solve 5X^2 + 6X + 1 = 0.
*/

#include <iostream>
#include <cmath>

using namespace std;

int main (void)
{
   double x1, x2 ;
   double discr, sqrtDiscr ;
   double a = 5.0, b = 6.0, c = 1.0 ;

   discr = b*b - 4*a*c ;
   sqrtDiscr = sqrt (discr) ;

   cout << "The discriminant is: " << discr << endl ;

   x1 = (-b + sqrtDiscr) / (2*a) ;
   x2 = (-b - sqrtDiscr) / (2*a) ;

   cout << "The first root is: " << x1 << endl ;
   cout << "The second root is: " << x2 << endl ;

   return 0 ;
}