The statement:
for(x = 1; x < 3; x++){
//do things here
}
is equivalent to the following:
x = 1;
while(x < 3){
//do things here
x++;
}
In the for() loop the first statement sets a variable equal to some starting value, when the second statement evaluates to false (or 0) the loop will stop, the last statement is run after each loop. So in a standard for loop you would start with a value, compare that value to some other value, then change that value after looping through some code.
The example above sets the variable x to 1 to start, then checks if x is less than 3, since x is equal to 1 and is less than 3 the loop goes into its first iteration. After this first iteration the value of x is increased to 2 (x++ is the same thing as x = x + 1). Then if x is still less than 3 (which it is) it loops again.
A while() loop is a little more straightforward. While the statement in the parenthesis (in this case x < 3) is true (or equal to some non-zero value) the loop will continue to loop indefinitely.
So if we set x equal to 1 before the loop begins, then check to see if x is less than 3 to begin the loop, then increment x at the end of every loop it is effectively the same thing as our previous for() loop.
I hope that wasn't too confusing, if you have any other questions or points to clarify let me know. Also, its been a little while since I've taken a programming course so if I left anything out... shame on me, and please correct me =)