Basic
Programming Language as it name implies is one of the
Simplest Programming Language. In as much as you follow the rules carefully,
you are good to go.
Off course you know Basic Programming Language
can be used in Numbers of Fields.
One of the Most important Rule in solving problem
with Programming, is to first solve that same problem manually. That is, in the
case of quadratic equation make sure the problem you are trying to solve can be
solved manually.
Secondly, after solving a problem with your
compiler, try to solve it manually to cross check your answer.
Am sure you know the Factorization Formula (also known as “Almighty Formula”) That is
what we are going to make use of here.
The
Factorization Formula (Almighty Formula) :--
Am sure you know that, to write this Equation
directly into the compiler will be somehow tedious. But, to make it easier am
going to simplify the equation a little bit.
The equation can also be written as:
Please
Note that Every Quadratic Equation is in the form :- ax2 + bx + c =0
Now the Programme Starts:
REM PROGRAMME TO SOLVE QUADRATIC EQUATION
Input “the value for a ”; a
Input “the value for b ”; b
Input “the value for c ”; c
d=0
x1=(b^2-4*a*c)
x1=x1^0.5
x1=d-b+x1
x1=x1/(2*a)
x2=(b^2-4*a*c)
x2=x2^0.5
x2=d-b-x2
x2=x2/(2*a)
print
"the roots are "; x1; " and "; x2
end
Note
The value of
a, b and c will be input by the user.
There
can be slight changes depending on the compiler you are using
Share
below through the Comment Box if you still encounter difficulties
If you Need Basic
Compiler you can email me on olayinkaemmanuel52@gmail.com
or you message me on 08078399673.
www.247techtips.blogspot.com
(The home of Technology Tips).