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:(adsbygoogle = window.adsbygoogle || []).push({});

#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);

}

**Physics Forums | Science Articles, Homework Help, Discussion**

Dismiss Notice

Join Physics Forums Today!

The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

# C++ code not compiling correctly

**Physics Forums | Science Articles, Homework Help, Discussion**