Thursday, September 20, 2012

While Loop & Do While Loop in C#.Net 2008

using System;
class Program
{
    static void Main(string[] args)
    {
       //While LOOP           

       int i;
       i = 0;
       while (i <= 10)
       {
           Console.WriteLine("While Loop");
           i++;
       }
      

       //Do While LOOP
       int j;
       j = 0;
       do
       {
          Console.WriteLine("do While Loop");
          j++;
       } while (j <= 10);
   

       Console.ReadLine();
   }
}

No comments: