Latest Posts:

a cpp program that can solve quodratic equation using inbuilt input

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
Share on Google Plus

About Lucky Ibitubo

This is a short description in the author block about the author. You edit it by entering text in the "Biographical Info" field in the user admin panel.
    Blogger Comment
    Facebook Comment

0 comments:

Post a Comment

Powered by Blogger.