uses Repeat to generate a sequence that contains the number 7 ten times.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
public class MainClass {
public static void Main() {
var numbers = Enumerable.Repeat(7, 10);
foreach (var n in numbers) {
Console.WriteLine(n);
}
}
}
Related examples in the same category