CSharp examples for Language Basics:while
The expression is tested before the body of the loop is executed. For example:
using System;//from www. j a va2 s. c o m class Test { static void Main(){ int i = 0; while (i < 3) { Console.WriteLine (i); i++; } } }