Programming Course for Beginners - ZedLX

The Easiest Online Computer Programming Course, for Free

Iteration [2/10]

This example prints on the screen the value of the loop control variable i, in each iteration.
[Run the program]

A for statement should not be ended by a semicolon because a for statement is not a plain statement. A for statement is a block-ended statement.

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

Exercise:

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

Bookmark your progress by using the gray sharing buttons. The sharing buttons for Twitter, Facebook, Pinterest, Reddit and LinkedIn are provided. The sharing buttons create a link to the current page.

Loading...