Loops Flashcards

1
Q

describes repeated addition, or subtraction, wherein the same statement is being repeated many times over, and at some point has to stop.

A

iteration / loops

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

checks whether the repetition still needs to be executed.

A

condition

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

that changes the value of
the variable used in the condition.

A

expression or statement

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

iterates through a block of code as long as a specified condition is true. can be executed many times over, as long as the condition in the parentheses evaluates to false

A

while loop

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

used if you know exactly the number of times you want to loop through a block of code.

A

for loop

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

once executed at the start of the loop. This will be executed once.

A

Initializer

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

behaves similarly with how the condition in the while loop behaves.

A

condition

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

performs the updates on certain variables that were used in the loop.

A

iterator

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

repetition is achieved by doing or executing the statement in the loop first, before checking
the condition.

A

do-while loop

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

when another loop exists in
the body of another loop.

A

nested loops

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

It terminates the loop immediately, and the control of the program will move to
the next statement after the loop. Also, it may be sometimes used in decision-making statements.

A

break

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

If the break statement cuts the execution, the continue statement skips.

It moves to the end of the iteration, and then the test expression is evaluated, and the update statement is evaluated in case of the for loop.

A

continue

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

possible to add break and
continue statements in nested loops.

A

nested loops

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

used for the outer loop.

A

break statement

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

used for the inner loop.

A

continue statement

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