For statements in C programming language

For statement

for (expr1; expr2; expr3)
statement is equivalent to expr1;
while (expr2)
{
statement
expr3;
}
except for the behaviour of continue, the three components of a forloop are expressions. Most commonly, expr1and expr3 are assignments or function calls and expr2 is a relational expression. Any of the three parts can be omitted, although the semicolons must remain. If expr1or expr3 is omitted, it is simply dropped from the expansion. If the test, expr2, is not present, it is taken as permanently true, so
for (;;) {
...
}
is an ``infinite'' loop, presumably to be broken by other means, such as a break or return.

learn more
While LOOP in C programming language

Previous
Next Post »