# Thread: Help with algebra code

1. and it happens to be..................*cough*....................*ah em*..............................*ack*............ .

2. Wow, instead of just typing it into google and getting the result immediately, you are persistent and ask as long as you don't get an answer ... try sqrt().

3. ok thanks i get the point, ill research stuff first next time

4. thanks for the help, and i thought id post another project i finished, this one solves quadratics
Code:
```#include <cstdlib>
#include <iostream>
#include <math.h>

using namespace std;

int main(int argc, char *argv[])
{
int e;
e = 1;
while (e == 1)
{
float a;
float b;
float c;
float x;
float w;
float q;
cout << "A = _";
cin >> a;
cout << "B = _";
cin >> b;
cout << "C = _";
cin >> c;
w = (-b + sqrt (pow (b,2) - 4 * a * c));
q = (w / (2*a));
cout << q;
system("echo .");
system("PAUSE");
w = (-b + sqrt (pow (b,2) - 4 * a * c)*-1);
q = (w / (2*a));
cout << q;
system("echo .");
system("pause");
cout << "Enter 1 to solve another one!";
cin >> e;
}
return EXIT_SUCCESS;
}```
my only problem with it is that i cant keep numbers as fractions, oh well!

5. Now try to code it so that it deals with imaginary numbers and also can give you an exact solution instead of the approximate. I did the same thing with my graphing calculator, but the teacher gives out a similar program with less functionality than mine. Either way I'm sure no one would pay for it and it pains me to see that you want to sell it especially when it's such a tiny program.