# for Loop Variable Manipulation

Recall, the third part of the header. We said the third part is "increment, i++". But this is not true.

A for loop can have any valid statement to manipulate the loop variable.

We can decrement, instead of increment.

 




for (int i = 10; i > 0; i--)
{
  Console.WriteLine(i);
}
1
2
3
4

We can increase the loop variable by 3, instead of 1.

 




for (int i = 0; i < 15; i += 3)
{
  Console.WriteLine(i);
}
1
2
3
4
Last Updated: Apr 22, 2020, 1:39 PM