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