iteration c# code example
Example 1: for loop c#
//int i = 0 -- Making variable i
//i <=10 -- Making a condition for the loop to keep going
//i++ -- Increasing i by 1
for(int i = 0; i <= 10; i++)
{
Console.Write(i+1);
}
/*
Output:
12345678910
*/
Example 2: iteration c#
for (int index = 0; index < days.Length; index++)
{
// Yield each day of the week.
yield return days[index];
}