The continue statement : Continue : Language Basics C# Source Code


Custom Search

C# Source Code » Language Basics » Continue »

 

The continue statement









    

/*
Mastering Visual C# .NET
by Jason Price, Mike Gunderloy

Publisher: Sybex;
ISBN: 0782129110
*/

/*
  Example4_14.cs illustrates the use of
  the continue statement
*/

public class Example4_14
{

  public static void Main()
  {

    int total = 0;

    for (int counter = 1; counter <= 10; counter++)
    {
      if (counter == 6)
      {
        System.Console.WriteLine("continue from loop start");
        continue;
      }
      System.Console.WriteLine("counter = " + counter);
      total += counter;
    }

    System.Console.WriteLine("total = " + total);

  }

}

           
       
    
   
  
   







HTML code for linking to this page:

Follow Navioo On Twitter

C# Source Code

 Navioo Language Basics
» Continue