Simplest do while : While « Language Basics « C# / C Sharp






Simplest do while

Simplest do while
/*
 * C# Programmers Pocket Consultant
 * Author: Gregory S. MacBeth
 * Email: gmacbeth@comporium.net
 * Create Date: June 27, 2003
 * Last Modified Date:
 */
using System;

namespace Client.Chapter_4___Program_Control
{
  public class DoWhile
  {
    static void Main(string[] args)
    {
      int a = 0;

      do
      {
        a++;
        Console.WriteLine(a);
      } while (a < 10);
    }
  }
}

           
       








Related examples in the same category

1.Continue in while
2.Compute the order of magnitude of an integer Compute the order of magnitude of an integer
3.Compute integer powers of 2Compute integer powers of 2
4.Display the digits of an integer in reverse orderDisplay the digits of an integer in reverse order
5.Using break to exit a do-while loopUsing break to exit a do-while loop
6.While TesterWhile Tester
7.Do While TesterDo While Tester
8.While SignalWhile Signal
9.While loop to display 1 to 5While loop to display 1 to 5
10.while loop to calculate and display the Fibonacci numbers less than 50while loop to calculate and display the Fibonacci numbers less than 50
11.a do...while loopa do...while loop
12.While true testWhile true test
13.Simplest while