Math.Max Function in VB.NET

What is the use of math.max() mathematical function in VB.NET?

Explanation

Math.Max Function

Math.Max() Mathematical Function in Visual Basic.net 2008 is used to return the largest of two decimal numbers.
Syntax:

Math.Max( val1, val2)

In the above syntax val1 and val2 are the two decimal values to find the largest among them.
Example:

Module Module1
Sub Main()
Dim val1 As Double = 12.21
Dim val2 As Double = 23.21
Console.WriteLine("Largest decimal value is::
" & Math.Max(val1, val2))
Console.ReadLine()
End Sub
End Module
Result:

Largest decimal value is:: 23.21

In the above example, the largest decimal value assigned to val2 is returned.

Visual Basic Tutorial


Ask Questions

Ask Question