This is how it works:
initialization - is evaluated once (typically sets a counter variable)
condition - is evaluated before each iteration (if true - continue loop)
increment - is evaluated after each iteration (typically used to increase/decrease the counter variable)
The following example shows a for loop that prints the numbers from 0 to 00:
Çalışma prensibi şu şekildedir:
Başlangıç - bir kez değerlendirilir (genellikle bir sayaç değişkeniayarlar)
Koşul - her yinelemeden önce değerlendirilir (doğruysa - döngüye devam et)
Artırma - her yinelemeden sonra değerlendirilir (genellikle sayaç değişkenini artırmak/azaltmak için kullanılır)
Aşağıdaki örnek, 0'dan 00'a kadar sayıları yazdıran bir for döngüsünü göstermektedir: