This is a small program that solves quadratic functions using the quadratic formula [math]x=\frac{-b\pm\sqrt{b^2-4ac}}{2a}[/math]. Function must be in the form [math]Ax^2+Bx+C=0[/math]
Input "A=",A
Input "B=",B
Input "C=",C
B^2-4AC->D
-B/(2A)->R
If D>0
Goto 1
If D<0
Goto 2
Disp "DOUBLE ROOT=",R->Frac
Stop
Lbl 1
sqrt(D)/(2A)->S
R-S->T
R+S->U
Disp "REAL ROOTS=",T->Frac,U->Frac
Stop
Lbl 2
sqrt(-D)/(2A)->I
Disp "COMPLEX ROOTS"
Disp "REAL PART=",R
Disp "+- IMAGINARY=",I
Stop
You must be logged in to post a comment.