Infinite Loops C#

infinite loops are the loops which are executed endlessly. They are often useful sometimes where we don’t know out terminating condition at initial but later some terminating condition is known and loop may exit.

Example

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

namespace ConsoleApplication1
{
    class Program
    {
        static void Main(string[] args)
        {
            int i = 0;
            while (true)
            {
                Console.WriteLine("{0}", i++);
                if (i == 10)
                    break;
            }
            Console.Read();
        }
    }
}