using System; using System.Linq; public class Test { public static int TrueCount(params bool[] booleans) { return booleans.Count(b => b); } public static void Main() { bool bool1 = true; bool bool2 = false; bool bool3 = true; bool onlyOneTrue = TrueCount(bool1,bool2,bool3)==1; Console.WriteLine("Only one true? " + onlyOneTrue); } }