Questions about Pascal fixed count iterations
Definition: Fixed-count iterations are controlled by the loop control variable (abbreviated LCV)
|
any discrete type: enumerated (including Boolean), char,
integer |
|
it can be printed inside the loop
and after the loop |
|
it can (at least in Free Pascal)
but it shouldn’t be |
|
if it hasn’t been modified within
the loop body by the programmer it
will have terminal (or final value) of the expression (or value) in the loop
header |
|
The increment or decrements happen
at the end of each loop iteration The final expression is only
evaluated upon intial entry into the loop |
|
No |
|
Yes for i := 10 downto 1 do |
|
Yes using a go to – it depends on
whether you transfer in before the LCV has been initialized or whether you
transfer in after the loop has begun. |
|
a begin end pair is required if there is more than one statement in the
body |
Yes, using a goto or a break |
|