xFactorSchool.com(Beta)
How to Do Examples
Python Examples
HTML Examples
Code Examples
C Code Examples
C++ Code Examples
C# Code Examples
Java Code Examples
Python Code Examples
HTML Code Examples
CSS Code Examples
JavaScript Code Examples
Online Editor
C Code Editor
C++ Code Editor
C# Code Editor
Java Code Editor
Python Code Editor
HTML Code Editor
CSS Code Editor
JavaScript Code Editor
Practice how to use range in C#
C# Online Editor
Execute Code
More C# Sample Code
using System; using System.Linq; //Add this namespace to use Enumerable class namespace ExampleApp { class Program { static void Main() { Console.WriteLine("Example of range:"); // Creating a range of 10 starting from 1 var range = Enumerable.Range(1, 10); // 1 is starting number of range and 10 is the number of sequence to be generated // loop through the range foreach (var number in range) { Console.WriteLine(number); } Console.WriteLine("Example of another range:"); // Creating a range of 30 starting from 51 var range2 = Enumerable.Range(51, 30); // 51 is the starting number of range and 30 is the number of sequence to be generated // loop through the range foreach (var number in range2) { Console.WriteLine(number); } } } }