CSharp examples for Language Basics:for
Keep for loop controlling variable to its own scope
using System;/* w w w . j a v a 2 s . com*/ class Scope { public static void Main() { for( int x = 1; x < 5; x++ ) { Console.WriteLine("x is {0}", x); } for( int x = 1; x < 5; x++ ) { Console.WriteLine("x is {0}", x); } } }