how do loops on C#

C#
// 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++; 
        } 
    } 
} for (int i = 0; i < 10; i++)
{
    Console.WriteLine("Value of i: {0}", i);
}
Source

Also in C#: