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