For Loop Code Examples

This post continues with examples in multiple languages of various coding routines. It’s goal is to assist someone transitioning from one language to another.

In this example we cover the simple for loop.

PHP


for ($i = 0; $i < 10; $i++) {
  // do something
}

C# and Objective C (iPhone)


for (var i = 0; i < 10; i++) {
  // do something
}

VB .NET


Dim i
for i = 1 to 10
  ' Do Something
Next

Leave a Reply