How to use while loop statement in C#?

Below code shows how to use while loop statement in csharp/C# –

using System;

namespace kodehelp.csharp.basic
{
    class WhileLoop
    {
        [STAThread]
        public static void Main(string[] args)
        {
            int number = 0;
            //
            // Iterate the while loop untile number is greater 
            // than 10.
            //
            while (number <= 10)
            {
                Console.WriteLine(number);
            }
            Console.ReadLine();
        }
    }
}

Please Post Your Comments & Reviews

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.