SPC  Version 0.9.5
 All Files Functions Groups Pages
The repeat statement

The repeat statement executes a loop a specified number of times.

This control structure is not included in the set of Standard C looping constructs. SPC inherits this statement from NQC. The syntax is shown below.

repeat (expression) body

The expression determines how many times the body will be executed. Note: the expression following the repeat keyword is evaluated a single time and then the body is repeated that number of times. This is different from both the while and do-while loops which evaluate their condition each time through the loop.

Here is an example of how to use the repeat loop:

int i=0;
repeat (8)
printf("%d\n", i++);