For Loops

A for loop is a type of loop that is generally used when the programmer knows before hand how many times the code must run.

In many modern languages, a for loop has three stages: An initializing stage, a condition checking stage, and an incrementing stage. The initializing stage is run immediately upon entering the loop, and the other two stages are run at the end of every iteration until the condition evaluates to be false.

Many variations exist among languages, but they generally have the same purpose.

Languages

Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License