Increment for loop by step n

Normally i++ increments i by 1, in order to increment i by nth count you can use i += n where n is any number.
e.g.
for (int i = 0; i < 11; i += 2)
{
Console.WriteLine(i);
}
Reference: Muthukumar (http://nadarmuthukumar.blogspot.in) Hope you liked this and let me know your thoughts on post through your comments :)

0 comments:

Twitter Delicious Facebook Digg Stumbleupon Favorites More