Mega Code Archive

 
Categories / C# / Language Basics
 

While true test

/* Learning C#  by Jesse Liberty Publisher: O'Reilly  ISBN: 0596003765 */  using System;  public class WhileTrueTester  {      public static void Main()      {          int counterVariable = 0;  // initialization          while (true)          {              Console.WriteLine(                  "counter: {0} ", counterVariable++); // increment              if (counterVariable > 10) // test                  break;          }      }  }