using System;
using System.Linq;
namespace ConsoleApplication_C_Sharp
{
class Program
{
static void Main(string[] args)
{
int[] arr = { 1, 2, 33, 4, 5, 15};
try
{
int n = arr.Single(element => element > 10);
Console.WriteLine(n);
}
catch (Exception ex)
{
Console.WriteLine(ex.Message);
}
}
}
}
/*
run:
Sequence contains more than one matching element
*/