For loops Flashcards

1
Q

what is iteration

A

doing things over and over repeatedly

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

general for loop form

A

for ( ; ; )
{

}

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

what does the condition for continuation mean

A

for as long as this condition is met, the loop will continue

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
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

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

what is the statement

A

the code which will be executed if the condition is met

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

what does the closing curly bracket mean

A

for loop is exited

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
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

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

layout of an enhanced loop

A

for (int t: primes)
{
body
}

How well did you know this?
1
Not at all
2
3
4
5
Perfectly