Calculation of the volumes is also peformed in a similar manner. After a jump is
made to P8 for calculation, execution returns to the main routines. In PO, the pro
gram ends after the volume of the octahedron is displayed. In P1, however, the
result calculated in P8 is divided by four to obtain the volume of the tetrahedron.
By using subroutines in this manner, steps can be shortened and programs be
come neat and easy to read.
The following illustration shows the flow of the program just presented.
PO P9 P1
By isolating the common portions of the two original programs and storing them
in separate program areas, steps are shortened and programs take on a clear
configuration.
- 1 2 9 -