Program.cs
 

using System;

namespace MyApplication
{
  class Program
  {
    static void Main(string[] args)
    {
      int i = 0;
      while (i < 10) 
      {
        Console.WriteLine(i);
        i++;
        if (i == 4) 
        {
          break;
        }
      }    
    }
  }
}

Result:
0
1
2
3