Quiz Complete, well Done!
What is the purpose of the break statement in programming?
What is the output of the following code?
i = 10
while i > 0:
print(i)
i -= 2
While loop
In the context of the EdExcel Computer Science iGCSE course, where is the break statement used?
What is a while loop?
Infinite loop
What is the output of the following code?
i = 0
while True:
print(i)
if i == 5:
break
i += 1
Which loop is ideal when the number of iterations is known?
In which direction does the control flow transfer when a 'break' statement is encountered?
A do-while loop is an example of a loop with
condition.
When is the 'continue' statement used in programming?
The condition of a while loop is checked before each
.
Break statement
In Python, the while loop is defined with the
keyword.
What happens when a 'continue' statement is executed in a loop?
Continue statement
A for loop is an example of
iteration where the number of iterations is known in advance.
What is the output of the following code?
i = 4
while i < 10:
print(i)
if i == 7:
break
i += 1
Which programming language supports the break statement?
Indefinite Iteration