|
Section 11: Branching and Looping160
|
|
A common use of a branch is to create a ‘‘loop’’ in
a program. For example, the following program calculates and displays the
square roots of consecutive whole numbers beginning with the number 1. The
calculator continues to compute the square root of the next consecutive whole
number until you press R/S to stop program
execution (or until the HP-41C overflows).
|
|
|
|
|
|
You may wish to clear some of the programs you have recorded in program
memory so that you will have room to include the problems in this and
following sections. Check CATALOG 1 to see
the names fo the programs and delete the ones you don’t wish to
save using CLP (clear program).
Subsequent problems in the handbook assume that program memory has been
cleared of all programs and no key assignments has been made.
|
|
Name the program ROOT and assign it to the TAN
key location.
|
|
|