We will print the numbers in the range specified in this example with C # Console Application.
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 |
static void Main(string[] args) { int n; Console.Write("Number :"); n = Convert.ToInt32(Console.ReadLine()); for (int i = 1; i <= n; i++) { Console.WriteLine(i); } Console.ReadKey(); } |
Output:
Download
Online Editor: