Answer

If we find the number that we are looking for, there's no need to continue looking. We simply break out of the loop with the GOTO and continue along our way. Notice that the target of the GOTO is the statement immediately following the end of the loop. Using a GOTO in this way, to prematurely break out of a loop, is acceptable.

Return to lesson.



Hamlet Project
hamlet@cs.utah.edu