For programmers, testers and tech geeks

Solve Quadratic Equation using C++

#include<iostream>
#include<conio.h>
#include<cmath>
using namespace std;
void main()
{
float a,b,c,x,Q,Q1;
cout<<"Enter the value of A =";
cin>>a;
cout<<"Enter the value of B =";
cin>>b;
cout<<"Enter the value of C =";
cin>>c;
x=sqrt(b*b-4*a*c); //The value of 4ac must be positive if not it give imaginary roots//
Q=0.5*(-b+x)/a;
Q1=0.5*(-b-x)/a;
cout<<"Quadratic Equation answer ONE is ="<<Q <<endl; 
cout<<"Quadratic Equation answer SECOND is ="<<Q1;
getch();
}