usig cpp to explain for ur replies in quodratic condition is as basic as a,b,c.just know how to apply them that is all you require.
In variable based math, a quadratic condition (from the Latin quadratus for "square") is any condition having the shape. where x speaks to an obscure, and a, b, and c speak to known numbers with the end goal that a is not equivalent to 0. On the off chance that a = 0, at that point the condition is straight, not quadratic.
//Quadratic Equation
#include<iostream>
#include<cmath>
using namespace std;
int main()
{
float a,b,c,b1,b2,x1,x2,determinant,squareroot,deniminator;
a=2;
b=3;
c=2;
determinant=(b*b)+(4*a*c);
squareroot=sqrt(determinant);
deniminator=(2*a);
b1=(-b+squareroot)/deniminator;
b2=(-b-squareroot)/deniminator;
if(determinant<0){
cout<<"No Sqrt of a -sign"<<endl;
}
else if(determinant>0){
x1=b1;
cout<<"X1 = "<<x1<<endl;
x2=b2;
cout<<"X2 = "<<x2<<endl;
}
return 0;
}
please comment any error
- Blogger Comment
- Facebook Comment
Subscribe to:
Post Comments
(
Atom
)
Powered by Blogger.
0 comments:
Post a Comment