Linq Any Operator With Condition

  1. using System;  
  2. using System.Collections;  
  3. using System.Collections.Generic;  
  4. using System.Text;  
  5. using System.Linq;  
  6.   
  7. public class MainClass{  
  8.    public static void Main(){  
  9.        int[] numbers = { 2, 6, 1, 5, 10 };  
  10.        Console.WriteLine("Is there at least one odd number?");  
  11.        Console.Write(numbers.Any(e => e % 2 == 1) ? "Yes, there is" : "No, there isn't");  
  12.    }  
  13. }