Max() ExamplesΒΆ

Compares two numeric values of the same type, and returns the LARGER of the set.

General Syntax

Math.Max(number1, number2)

Example

1
2
3
4
double test1 = 342.42;
double test2 = 9819;

Console.WriteLine(Math.Max(test1, test2));

Console Output

9819