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