for (initial value, max value, increment) {
statement1;
statement2;
statement3;
}
For example:
This would display:
The while keyword repeats while a condition is true:
Select this link to test it.
Conditionals The if...else structure can check values and respond:
Logical and Comparison Operators
| == | Equal to |
| != | Not equal |
| > | Greater than |
| < | Less than |
| >= | Greater than or equal to |
| <= | Less than or equal to |
| || | Logical OR |
| && | Logical AND |
Arrays can be defined as an ordered collection of data. To establish an array:
This example shows the use of some of these commands, including for, if, and array:
|
|
Here's how that would look:
Hints:
Here's an example of how to do it.