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**

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

Loading...

Similar Threads for code compiling correctly |
---|

C/++/# Question about running "executables" without source code |

C/++/# Open source adaptive mesh code |

What should be the rules to write excellent code? |

Converting a DFA to efficient code? |

Python How can I run Python by getting values from Matlab |

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