- #1

- 420

- 0

## Main Question or Discussion Point

I'm pretty sure I wrote the correct code for the quadratic formula and yet Dev-C++ continues to find a problem with my code. I will post the code I've written:

#include<iostream.hpp>

#include<math.h>

int main()

{

double root1,root2,a,b,c,root;

cout << "Enter the coefficients a,b,c: "; ! This is the line where Dev-C++ finds an error

cin >> a >> b >> c;

root=sqrt(b*b-4.0*a*c);

root1=.5*(root-b)/a;

root2=-.5*(root-b)/a;

cout << "The solutions are " <<root1 << " and " <<root2 << "\n";

return(0);

}

#include<iostream.hpp>

#include<math.h>

int main()

{

double root1,root2,a,b,c,root;

cout << "Enter the coefficients a,b,c: "; ! This is the line where Dev-C++ finds an error

cin >> a >> b >> c;

root=sqrt(b*b-4.0*a*c);

root1=.5*(root-b)/a;

root2=-.5*(root-b)/a;

cout << "The solutions are " <<root1 << " and " <<root2 << "\n";

return(0);

}