Friday, March 10, 2017

Loop (do while loop)

// # The do ... while loop ensures that the body of the loop executes at least once.

// 1 to 100 series using do while
using System;

namespace TestLoop
{
    class Program
    {
        static void Main(string[] args)
        {
            int i = 1;
            do
            {
                Console.WriteLine("{0}\n", i);
                i++;
            }
            while (i <= 100);
            Console.ReadKey();
        }
    }
}
 

No comments:

Post a Comment