terça-feira, 7 de maio de 2013

Pascal For...To...Do


Control Structures - Module 3

3. Control Structures

3.5. For...To...Do

This Control structure uses a counter, it is very useful if you already know how many times you want the loop to repeat itself.

Syntax:

FOR <variable name> := <number to start at> TO <ending value> DO
<Instruction>


If you read my previous lesson on While... Do the next example has the same output as the one on that lesson, however this time I use a For... To... Do loop.

Example:

Output:




0 comentários

Posts a comment

 
© Doc's Workshop
Designed by Blog Thiết Kế
Back to top