For loops Flashcards
1
Q
what is iteration
A
doing things over and over repeatedly
2
Q
general for loop form
A
for ( ; ; )
{
}
3
Q
what does the condition for continuation mean
A
for as long as this condition is met, the loop will continue
4
Q
what is the increment
A
what the value initilalised as increases or decreases by each time the code is run . It happens after statement is run
5
Q
what is the statement
A
the code which will be executed if the condition is met
6
Q
what does the closing curly bracket mean
A
for loop is exited
7
Q
what is an enhanced loop
A
does it for each element of an array. takes an array and declares a compatible variable type
8
Q
layout of an enhanced loop
A
for (int t: primes)
{
body
}