Roots of a quadratic function: Difference between revisions
Content added Content deleted
Line 848: | Line 848: | ||
=={{header|IS-BASIC}}== |
=={{header|IS-BASIC}}== |
||
<lang IS-BASIC> |
<lang IS-BASIC> |
||
100 PROGRAM "Quadratic.bas" |
|||
110 INPUT PROMPT "a= ,b= ,c= ":A,B,C |
110 PRINT "Enter coefficients a, b and c:":INPUT PROMPT "a= ,b= ,c= ":A,B,C |
||
⚫ | |||
120 IF A=0 THEN |
|||
⚫ | |||
130 PRINT "The coefficient of x^2 can not be 0." |
|||
140 |
140 ELSE |
||
150 PRINT "The single root is ";-B/2/A |
|||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
170 CASE 0 |
|||
180 PRINT "The single root is ";-B/2/A |
|||
⚫ | |||
⚫ | |||
⚫ | |||
210 CASE -1 |
|||
220 PRINT "The complex roots are ";-B/2/A;"+/- ";STR$(SQR(-D)/2/A);"*i" |
|||
230 END SELECT |
|||
⚫ | |||
=={{header|J}}== |
=={{header|J}}== |