Learn to Program with ZedLX

Free Online Programming Course for Beginners

Basics of for Loops [4/10]

In this example, the body of the for loop contains three statements inside a statement block.
[Run the program]

The argument of the sleepMs function is 500 milliseconds, which is half a second.

Exercise:

1. Inside the for loop body, add the statement: println i;

Loading...