c# for loop decrement
Certainly, here's an example of a decrementing for
loop in C#:
for (int i = 10; i > 0; i--)
{
Console.WriteLine(i);
}
This loop initializes i
to 10, runs as long as i
is greater than 0, and decrements i
by 1 in each iteration, printing the value of i
in each loop iteration.