View Feed
group-icon
Coffee Room
Discuss anything here - everything that you wish to discuss with fellow engineers.
12774 Members
Join this group to post and comment.
maria flor
maria flor • Feb 19, 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
#include
#inlude

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???

Share this content on your social channels -