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 >
Commodore BASIC  |  2022-10-26  |  543b  |  33 lines

  1. 10 rem mpk1 quadratische gleichungen
  2. 15 :
  3. 20 rem algebraische loesung
  4. 25 :
  5. 30 rem werte nach der gleichung:
  6. 40 rem a*x^2+b*x+c=0
  7. 45 :
  8. 50 rem vorgaben:
  9. 55 :
  10. 60 a=1: b=-20: c=51
  11. 65 :
  12. 70 rem berechnung/ausgabe:
  13. 75 :
  14. 80 d=b^2-4*a*c: rem diskriminante
  15. 85 :
  16. 90 if d<0 then 210
  17. 100 if d=0 then x=-b/(2*a): goto 180
  18. 110 :
  19. 120 x1=-(b+sqr(d))/(2*a)
  20. 130 x2=-(b-sqr(d))/(2*a)
  21. 135 :
  22. 140 print"es gibt zwei loesungen:"
  23. 150 print"x1=";x1
  24. 160 print"x2=";x2
  25. 170 end
  26. 175 :
  27. 180 print"es gibt genau eine loesung:"
  28. 190 print"x=";x
  29. 200 end
  30. 205 :
  31. 210 print"diese gleichung besitzt keine loesung."
  32. 220 end
  33.