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