maria flor
maria flor
Branch Unspecified
19 Feb 2012

Discriminant in C++

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 ellipse;
    • if A = C and B = 0, the equation represents a circle, which is a special case of an ellipse;
  • if B2 − 4AC = 0, the equation represents a parabola;
  • if B2 − 4AC > 0, the equation represents a hyperbola;
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???

Be the first one to reply

Share this content on your social channels -

Only logged in users can reply.