CSharp examples for Language Basics:for
Use two variables to control for loop
using System;//from w w w . jav a 2 s .co m class OneThird { public static void Main() { int i; int j; Console.WriteLine("Value of\n i j\n"); for (i=0, j=21; i <= j; i++, j=j-2) Console.WriteLine(" {0} {1}", i, j); } }