Wednesday, May 27, 2009

For Loop in Objective-C

Loops are the gears of a programming language.

They help move the program to the next step. A For loop is generally used when you want your program to repeat an action a set number of times. 

Here is the syntax for the For Loop:
 
    for (int y = 0; y < 3; y++) {
        NSLog(@"y = %i", y);
    }
 
 
That is it!

No comments: