Mega Code Archive

 
Categories / C# Tutorial / Statement
 

A negatively running for loop

using System;    class MainClass {        public static void Main() {          int x;        for(x = 100; x > -100; x -= 5)        Console.WriteLine(x);    }  } 100 95 90 85 80 75 70 65 60 55 50 45 40 35 30 25 20 15 10 5 0 -5 -10 -15 -20 -25 -30 -35 -40 -45 -50 -55 -60 -65 -70 -75 -80 -85 -90 -95