Learn to Program with ZedLX

Free Online Programming Course for Beginners

Basics of for Loops [6/10]

This example prints out the first 10 multiples of number 3.
[Run the program]

A string is a text, a sequence of characters, which may include letters, digits, spaces, punctuation, and other kinds of characters.

A single quote is a character called “an apostrophe”. A double quote character is more precisely called “a quotation mark”.

Strings can be enclosed in single quotes and then they may contain double quotes.

An empty println statement creates an empty line by advancing to the next line.

Exercise:

1. Modify the program so that it prints out the first ten multiples of number 7.
[Run the program]

2. Rename the variable i to z.
[Run the program]

Loading...