A program to find the x values of a quadratic equation
<p>Given the values of a=1, b=5 and c=6, the values of x are supposed to be -2 and-3, but the following program gives the values of x as 6 and -11, which are incorrect. I'd be grateful if someone could figure out what's wrong with the program.</p>

<pre><code>#include&lt;iostream.h&gt;
#include&lt;conio.h&gt;

int main()
{
    char reply;
    int a,b,c,q,z;

    do
    {
        cout&lt;&lt;"Enter the value of a: ";
        cin&gt;&gt;a;
        cout&lt;&lt;"\nEnter the value of b: ";
        cin&gt;&gt;b;
        cout&lt;&lt;"\nEnter the value of c: ";
        cin&gt;&gt;c;

       q=(-b-(b*b-4*a*c)sqrt(b))/2/a;

       z=(-b+(b*b-4*a*c)sqrt(b))/2/a;

        cout&lt;&lt;"\nThe values of x are "&lt;&lt;q&lt;&lt;" and "&lt;&lt;z;
        cout&lt;&lt;"\nDo you want to find another values of x(y/n)?";
        cin&gt;&gt;reply;
    }
    while(reply=='y');

    getch();
    return 0;
}
</code></pre>
