Count numbers > 5 in 1..10.
Ready — edit the code above and click Run.
using System;
class Program
{
static void Main()
{
using System.Linq;
Console.WriteLine(Enumerable.Range(1, 10).Count(x => x > 5));
}
}
Try solving on your own first, then reveal the official answer.
Count with predicate.