Write a C# Console Application program to print numbers between 1 to 100 using for loop.
Example 1:
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 |
class Program { static void Main(string[] args) { for(int i=1;i<=100;i++) { Console.WriteLine(i); } Console.ReadKey(); } } |
Output:
Example 2:
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 |
class Program { static void Main(string[] args) { for(int i=1;i<=100;i++) { Console.Write(i+" "); } Console.ReadKey(); } } |
Output:
Online Output: