Counter based while loop - CSharp Language Basics

CSharp examples for Language Basics:while

Description

Counter based while loop

Demo Code

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!");
   }
}

Result


Related Tutorials