I keep getting the result of nan for the x1 and x2 values, can someone please tell me what i'm doing wrong?
#include <iostream>
#include <cmath>
using namespace std;
int main()
{
/*
----------------------------------------------------
This program is by Brandon Cavendish. 9/7/2017
It will find the real roots for a quadratic equation
x1, x2 = -b+-sqrt(b^2-4ac)/2a
----------------------------------------------------
*/
// declaring variables.
double a = 0.0;
double b = 0.0;
double c = 0.0;
double x1 = 0.0;
double x2 = 0.0;
double discriminant = b * b - 4 * a * c;
/*
----------------------------------------------------
This program is by Brandon Cavendish. 9/7/2017
It will find the real roots for a quadratic equation
x1, x2 = -b+-sqrt(b^2-4ac)/2a
----------------------------------------------------
*/
// declaring variables.
double a = 0.0;
double b = 0.0;
double c = 0.0;
double x1 = 0.0;
double x2 = 0.0;