Wed 04 July 2018, in category Loop
The ol' reliable for loop. One of the first looping constructs taught in most programming languages, which enables you to execute a set of statements until the for expression evaluates to false.
Here are a few examples from various languages, all of which print 0 through 9 out to the console.
for (int i=0; i<10; i++)
{
System.out.println(i);
}
for (int i=0; i<10; i++)
{
Console.WriteLine(i);
}
for x in range(0,10):
print(x)
for (i=0; i<10; i++){
console.log(i);
}
for i:=0; i<10; i++ {
fmt.Println(i)
}