max function c# code example Example 1: c# max function Math.Max(n1, n2) Example 2: c# max two values <T> max = Math.Max(<T>,<T>);