CrazyEngineers
  • Discriminant in C++

    maria flor

    maria flor

    @maria-flor-8cAkif
    Updated: Oct 25, 2024
    Views: 1.2K
    I'm having some problem on a program i create. the purpose of this program is to identify what type of conic using discriminant.
    • f B2 − 4AC < 0, the equation represents an <a href="https://en.wikipedia.org/wiki/Ellipse" target="_blank" rel="nofollow noopener noreferrer">Ellipse</a>;
      • if A = C and B = 0, the equation represents a <a href="https://en.wikipedia.org/wiki/Circle" target="_blank" rel="nofollow noopener noreferrer">Circle</a>, which is a special case of an ellipse;
    • if B2 − 4AC = 0, the equation represents a <a href="https://en.wikipedia.org/wiki/Parabola" target="_blank" rel="nofollow noopener noreferrer">Parabola</a>;
    • if B2 − 4AC > 0, the equation represents a <a href="https://en.wikipedia.org/wiki/Hyperbola" target="_blank" rel="nofollow noopener noreferrer">Hyperbola</a>;
      • if we also have A + C = 0, the equation represents a <a href="https://en.wikipedia.org/wiki/Hyperbola" target="_blank" rel="nofollow noopener noreferrer">Hyperbola</a>.
    a conic is a circle if A=C, an ellipse if A is not equal to C but have the same sign, a parabola if either A=0 or C=0 and a hyperbola if A and C have different sign.
    #include<iostream.h>
    #include<conio.h>
    #inlude<math.h>

    int main ()
    {
    clrscr ();
    int B,A,C, sub;
    cout<<"Enter the value for B:";
    cin>>B;
    cout<<"Enter the value for A:";
    cin>>A;
    cout<<"Enter the value for C:";
    cin>>C;

    sub=(B^2)-(4*A*C);
    .....end
    can someone help me on how to continue it???
    0
    Replies
Howdy guest!
Dear guest, you must be logged-in to participate on CrazyEngineers. We would love to have you as a member of our community. Consider creating an account or login.
Home Channels Search Login Register