Friday 23 January 2015

C# Example program for do while

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace @while
{
    class Program
    {
        static void Main(string[] args)            
        {
            int i = 1;
            while (i < 5)
             //while (i++ < 8)
           //  while (++i < 5)
           //  while (i-- < 5)
          //  while (--i < 5)
            {
                Console.WriteLine(i);
                i++;

            }
            Console.ReadLine();
        }
    }
}



No comments:

Post a Comment