Learn to Program with ZedLX

Free Online Programming Course for Beginners

Basics of for Loops [2/10]

This example shows the value of the loop control variable i in each iteration.
[Run the program]

Important Note:
  • A for statement must not end with a semicolon, because it is a block-ended statement.

The statement sleepMs(500) pauses execution for exactly one half of a second.

Exercise:

  1. Modify the program so that it prints out 30 numbers.

You can bookmark your progress using the gray sharing buttons. The sharing buttons create a link to the current page.

Loading...