Following program shows you how to print numbers from 1 to 1000 using for loop.
1 2 3 4 5 6 7 8 9 |
class MainClass { public static void Main (string[] args) { for (int i= 1; i<= 1000; i++) { Console.WriteLine(i); } } } |
Output:
1 2 3 4 5 6 7 8 9 10 11 12 |
1 2 3 4 5 6 . . . 1000 |