home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
8bitfiles.net/archives
/
archives.tar
/
archives
/
genie-commodore-file-library
/
C64Educational
/
QUADRATIC
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2019-04-13
|
768b
|
32 lines
1 PRINT"":POKE 53280,0:POKE 53281,0
10 PRINT"[147]"
13 PRINT" A(X**2)+B(X)+C=0":PRINT""
14 A=0:B=0:C=O
15 PRINT" ENTER A:"
17 INPUT A
20 PRINT" ENTER B:"
25 INPUT B
30 PRINT" ENTER C:"
32 INPUT C
35 PRINT
39 PRINT"THE QUADRATIC IS;":PRINT""
40 PRINT" "A"(X**2)+"B"(X)+"C"=0":PRINT""
45 X=(B^2)-(4*A*C)
46 IF A=0 THEN PRINT"THIS IS NOT A QUADRATIC, A=0":GOTO 120
50 IF X<0 THEN GOTO 100
60 Y(1)=((-B)+(X^0.5))/(2*A)
62 Y(2)=((-B)-(X^0.5))/(2*A)
70 PRINT"":PRINT""
75 PRINT"THE ROOTS ARE;":PRINT""
76 PRINT"ROOT1="Y(1):PRINT"":PRINT"ROOT2="Y(2):PRINT""
80 GOTO 120
100 PRINT"":PRINT""
105 PRINT"THE ROOTS ARE IMAGINARY,THEY ARE;":PRINT""
109 D=(-B):E=((-X)^0.5):F=(2*A)
110 PRINT"ROOT1="D/F"+("E/F")J":PRINT""
115 PRINT"ROOT1="D/F"-("E/F")J"
120 PRINT"":PRINT"":PRINT"DO YOU WANT TO RUN AGAIN?(Y/N)"
130 GET A$:IFA$="" THEN 130
132 IF A$="Y" THEN GOTO 10
134 NEW:END