Basic HTML Version

|  | Table of Contents |  | View Full Version

Page 85 - 2632_CodeMind
P. 85

    When you run the project, the following output displays the first iteration of the while loop.

                      Now, click on the A button in the Game Controls to view the further output till it reaches the last iteration
                      of the while loop.

                             JUMP STATEMENTS

                      Jump statements in programming are used to change the flow of control by skipping, starting again or
                      exiting certain parts of the code. We can use break and continue statements for the same. These statements
                      are known as jump statements.

                           Break

                      The break statement changes the normal flow of execution of the statement by exiting the existing loop
                      and continuing the flow of statement after that loop. Using break statement, the control skips the lines
                      after the break statement if present and executes the first statement outside the loop. Break statement is
                      used to come out of a loop early when the specific condition is met. For example: if you’re going through
                      items and find what you’re looking for, you can use break to exit the loop early.

                      84    Premium Edition-VIII

| 80 81 82 83 84 85 86 87 88 89 90 |