Beruflich Dokumente
Kultur Dokumente
The program below calculates the sum of numbers entered by the user until user enters a negative
number.
WEEK 5: JUMP STATEMENTS OBJECT – ORIENTED PROGRAMMING
OUTPUT:
i = 1; j = 1
i = 1; j = 2
i = 2; j = 1
WEEK 5: JUMP STATEMENTS OBJECT – ORIENTED PROGRAMMING
When continue statement is executed, control of the program jumps to the end of the loop. Then, the
test expression that controls the loop is evaluated. In case of for loop, the update statement is executed
before the test expression is evaluated.
There is another form of continue statement, labeled form, that can be used to skip the execution of
statement(s) that lies inside the outer loop.
OUTPUT:
a = 1======== b = 1
a = 1======== b = 2
a = 3======== b = 1
a = 3======== b = 2
a = 4======== b = 1
a = 4======== b = 2