Math.Max Function in VB.NET

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


Math.Max Function

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

Math.Max( val1, val2)

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

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))
End Sub
End Module

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