Do While in C#

using System;
 
public class DoWhileExample
{
   public static void Main( string[] args )
   {
      int counter = 1; // initialize counter
 
      do
      {
         Console.Write( "{0}  ", counter );
         ++counter;
      } while ( counter <= 10 ); // end do...while 
 
      Console.WriteLine(); // outputs a newline
   } // end Main
} // end class DoWhileExample

Enjoyed this post? Share it!

 

Leave a comment

Your email address will not be published.