|
Section 12: Subroutines183
|
|
|
|
Run the QROOT program now to find the roots of the equation
x2 + x – 6 = 0
(a = 1, b = 1, c = –6); of
3x2 + 2x –1 = 0
(a = 3, b = 2, c = –1):
|
|
|
|
If the quantity b2 – 4ac is
a negative number, the calculator will display
DATA ERROR to let you know that the
program has attempted to find the square root of a negative number. The program
will stop running.
|
|
Details of Subroutine Usage
|
|
Subroutines give superb versatility in programming. A subroutine can contain a
loop, or it can be executed as part of a loop. Subroutines can even be complete
programs with their own ALPHA labels; separate from the program that executes
it.
|