Possible Duplicates:
Iterate with for loop or while loop?
Loops in C - for() or while() - which is BEST?
When should one use a for loop instead of a while loop?
I think the following loops are identical, except for their syntax. If so, then why choose one over the other?
int i;
for (i = 0; i < arr.length; i++) {
// do work
}
int i = 0;
while (i < arr.length) {
// do work
i++;
}