for loop from 1 to 10 - CSharp Language Basics

CSharp examples for Language Basics:for

Description

for loop from 1 to 10

Demo Code


class MainClass/*w ww .  j a  va 2 s  .co m*/
{
    public static void Main()
    {
        int x = 0;

        for( x = 1; x <= 10; x++ )
        {
             System.Console.Write("{0:D3} ", x);
        }
    }
}

Result


Related Tutorials