The initialization clause sets the initial conditions. Then the tes t is done, and if it yields a true value, the statement is executed, and the increment clause is executed, followed by the test again. This keeps happening until the test yields a value of false . Take a look at the NSquared application for a simple example of an if statement and a for loop. You can copy, compile and run this program to see it in action.
Arrays are variables that store more than one value, with each value identified by an index.
The index is an integer, with the first index being zero. Therefore, if an array has ten elements, the indices range from zero to nine. The NStats application illustrates an example of an array. You can copy, compile, and run this file as an application. You can enter as many numbers as you want on the command line.