Friday, March 10, 2017

Loop (while loop)

//  #While loops are good for when the loop's terminating condition happens at some yet-to-be determined time.

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

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

No comments:

Post a Comment