Topic 6 - Loops Flashcards

1
Q
Is this proper for loop syntax?
i = 4;
for (i>0;)
i--
do something with i
A

yes. Its basically a while statement.

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

Can a variable declared inside a for statement be accessed outside the for loop?

A

No. it is “invisible” outside the for loop.

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

The comma operator has what order of evaluation?

A

Comma operator = left-associative

Left-hand side evaluated first, then the next right comma and so forth.

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