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