cycle for c# code example
Example 1: looping in c#
//the while loop
while (condition)
{
// code block to be executed
}
//the for loop
for (statement 1; statement 2; statement 3)
{
// code block to be executed
}
//the foreach loop
foreach (type variableName in arrayName)
{
// code block to be executed
}
Example 2: loop in c#
public class MyClass
{
void Start()
{
//Called when script inithilizes
}
void Update()
{
//called each fram
}
}
//note this is in C#