.net while loop code example Example: c# while loop int n = 0; while (n < 5) { Console.WriteLine(n); n++; }