# VBForums CodeBank > CodeBank - Other >  [TI-83] Solve Quadratic Equations

## penagate

Simple program for the Texas Instruments TI-83 graphics calculator, for solving quadratic equations.



```
QUADEQ

a+bi
Disp "INSERT A,B,C"
Prompt A,B,C
(-B+(√(B²-4AC)))/(2A)->V
(-B-(√(B²-4AC)))/(2A)->W
If (B²-4AC)<0
Then
Fix 6
Else
Float
End
Disp "ZEROS:"
If Str0="Y"
Then
Disp V>Frac,W>Frac
Else
Disp V>Dec,W>Dec
End
((-B)/(2A))->D
AD²+BD+C->E
If A<0
Then
Disp "LOCAL MAX="
Else
Disp "LOCAL MIN="
End
If Str0="Y"
Then
Disp E>Frac,"WHEN X=",D>Frac
Else
Disp E>Dec,"WHEN X=",D>Dec
End
Float
```

And an accompanying function to turn fractions mode on and off:


```
SETMODE

Menu("FRACTIONS?","ON",A,"OFF",B)
Lbl A
"Y"->Str0
Disp "FRACTIONS ON"
Stop
Lbl B
"N"->Str0
Disp "FRACTIONS OFF"
```

----------


## penagate

*Index of TI-83 programs by me*

 Solve Quadratic Equations
 Binomial Probability
 Compound and Simple Interest
 Normally Centred Distribution

----------


## LLannie52

When I try to run the program, I'm getting this error message:
ERR: UNDEFINED
and when I choose Goto, it takes me back to this line:
If Str0="Y"

I don't understand what I've done wrong.

----------


## penagate

I'm sorry, I didn't make it clear in the original post.  You need to run the SETMODE program first in order to assign Str0; then run QUADEQ.

One probably ought to build in a check for this condition in QUADEQ.  Perhaps an exercise for you?   :Smilie:

----------

