Quiz Complete, well Done!
While loop
Infinite loop
When is the 'continue' statement used in programming?
Which programming construct does the 'break' statement typically belong to?
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 = 0
while True:
print(i)
if i == 5:
break
i += 1
The condition of a while loop is checked before each
.
In
iteration, the number of iterations is not known in advance.
How do you terminate a while loop?
What is a while loop?
Continue statement
A do-while loop is an example of a loop with
condition.
In the context of the EdExcel Computer Science iGCSE course, where is the break statement used?
For loop
How do you exit an infinite loop?
What is the purpose of the 'break' statement in programming?
What happens if the condition of a while loop is initially false?
Control flow
What is the output of the following code?
i = 0
while i < 5:
i += 1
if i == 3:
continue
print(i)
Conditional loop