Now for while and do-while loops, which do the exact same thing as for loops, minus a few structural elements. Your basic while loop consists of two parts: the condition and the loop's code. The while loop first checks the condition and then executes the code over and over until the condition evaluates to false. That is, it is, like the for loop, it is possible for the code within the loop to never execute. The while loop is constructed as such:

while(a < 5)
{
  a++;
}

This example demonstrates an important fact: the loop's code MUST do something to the variable used in the condition or else you're going to get an endless loop. Beyond that, the while loop is too simple to warrant further explanation. The do-while loop is similarly simple. It is slightly different from the other two loops in that its loop code always executes at least once; the condition isn't checked until the after the first execution. It looks like this.

do
{
  a++;
}while(a < 5);

Of note is the semicolon after this loop. Like I said, the loop's code will execute first and THEN it will check the condition. Aside from that, there is little more to be said about it.