CSharp examples for Language Basics:while
Counter based while loop
using System;//from w w w . jav a 2 s . co m class PlayItAgain { public static void Main() { int counter = 12; while(counter > 0) { Console.WriteLine("Play"); counter--; } Console.WriteLine("That's it folks!"); } }