Attempting quadratic formula

Hello,
For my assignment I have to create a program that calculates the quadratic formula. I am at most basic beginner and am having troble, I was told to break up the formula into smaller equations. I have looked at other forums but they use functions that i believe is passed our chapters for class.

code:

#include <iostream>
#include <cmath>

using namespace std;
int main()

{
/*
Quadratic equation: -b+- sqrt(b*b-4*a*c) / 2a
break down into steps
1. -b/a
2.b*b-4ac
3.?b*b-4a
4.?b*B-4ac / 2a
*/

double a,b,c;

double eq1 = double();
double eq2 = double();
double eq3 = double();
double eq4= double();






cout<<" \nEnter Values for a,b,c:\n"<<endl;

cout<< "a:";
cin>>a;
cout<<"b:";
cin>>b;
cout<<"c:";
cin>>c;

eq1= ((-b)/a);

eq2= ((b*b)-(4*a));
cout<<eq2;


/*for(int i = 0; i < 2; i++)
{
cout<<"x = "<< x[i] <<endl;
}*/

//(b^2 - 4ac must be >= 0)

if (a==0)
cout<<"Error A is 0"<<endl;



system("pause");
return 0;





}


all help is appreciated
Topic archived. No new replies allowed.