How to use while loop statement in C#?

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

[csharp toolbar=”true”]
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();
}
}
}
[/csharp]

Please Post Your Comments & Reviews

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