//*************************************************************************
//  Name:            David Wills
//  Program:         quad1.cpp                    Version 1
//  Compiler:        g++
//  Date:            28 Oct. 1999
//  Location:        Kadena Air Base
//
//  This program computes the quadratic formula.  It asks the user
//  to enter the three coefficients of a quadratic expression.
//  The two possible solutions for the variable are determined
//*************************************************************************


#include <iostream>
#include <cmath>

using namespace std;

int main () {
  float a, b, c, x1, x2;

  //input the coefficients
  cout << "Enter a, b and c: ";
  cin >> a >> b >> c;

  // calculate the two possible values for x.
  x1 = (-b + sqrt((b*b) - 4*a*c)) / (2 * a);
  x2 = (-b - sqrt((b*b) - 4*a*c)) / (2 * a);
 
  //display the two solutions
  cout << "x1: " << x1 << "    x2: " << x2 << endl;
}



