Check out example codes for "how do loops on C#". It will help you in understanding the concepts better.

Code Example 1

// C# program to illustrate while loop 
using System; 
  
class whileLoopDemo 
{ 
    public static void Main() 
    { 
        int x = 1; 
   
        // Exit when x becomes greater than 4 
        while (x <= 4) 
        { 
            Console.WriteLine("Hello World"); 
            // Increment the value of x for 
            // next iteration 
            x++; 
        } 
    } 
}

Code Example 2

for (int i = 0; i < 10; i++)
{
    Console.WriteLine("Value of i: {0}", i);
}

Learn ReactJs, React Native from akashmittal.com