foreach (x in Enumerable.Range(1, 4)) code example Example: enumerable.range contains IEnumerable<int> squares = Enumerable.Range(4, 3).Select(x => x * x);