Jumping
The jump statements allow you to alter the sequence of instructions in the code, getting the computer to jump to another instruction. You have already seen jumping in action in branching and looping, but many programming languages also provide explicit jumping instructions, visualised in the image below.
There are two kinds of jumping statements: structured and unstructured.
Structured jumping statements like break and continue only allow you to jump to specific points in your code. When you use these, take care that you do not complicate the overall sequence of your code unnecessarily. Unstructured jumping statements like goto allow you to jump to any instruction within the code. You need to be aware that these statements exist, but they should not be used.
We’ll explore each of these jumping statements in detail now.