guys, I am trying to make a code that can factor quadratic equation but this only works when the equation is positive. Here is the code. Please help
#include<iostream>
#include<conio.h>
#include<stdio.h>
using namespace std;
int main()
{
double a,b,c,ac,n,m;
cout<<"Enter a: ";cin>>a;cout<<endl;
cout<<"Enter b: ";cin>>b;cout<<endl;
cout<<"Enter c: ";cin>>c;cout<<endl;
ac = a*c;
for(n=0;n<=ac;n=n+2)
{
m= ac/n;
if(n+m==b&&n*m==c)
{
cout<<"(x + "<<n<<") (x + "<<m<<")"<<endl;
break;
}
}
return 0;
}