CSharp – for Statement


using System;

namespace ConsoleApplication1
{
    class Program
    {
        static void Main(string[] args)
        {
            int number = 5;

            for(int i = 0; i < number; i++)
                Console.WriteLine(i);

            // the console will close if you press Return on the keyboard
            Console.ReadLine();
        }
    }
}

The result is:
0
1
2
3
4