home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
64'er 1990 March
/
64er_Magazin_90-03_1990_Markt__Technik_de_Side_A.d64
/
algebra
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2022-10-26
|
543b
|
33 lines
10 rem mpk1 quadratische gleichungen
15 :
20 rem algebraische loesung
25 :
30 rem werte nach der gleichung:
40 rem a*x^2+b*x+c=0
45 :
50 rem vorgaben:
55 :
60 a=1: b=-20: c=51
65 :
70 rem berechnung/ausgabe:
75 :
80 d=b^2-4*a*c: rem diskriminante
85 :
90 if d<0 then 210
100 if d=0 then x=-b/(2*a): goto 180
110 :
120 x1=-(b+sqr(d))/(2*a)
130 x2=-(b-sqr(d))/(2*a)
135 :
140 print"es gibt zwei loesungen:"
150 print"x1=";x1
160 print"x2=";x2
170 end
175 :
180 print"es gibt genau eine loesung:"
190 print"x=";x
200 end
205 :
210 print"diese gleichung besitzt keine loesung."
220 end