Imports System
Public Class Program
Public Shared Function gcd(a As Integer, b As Integer) As Integer
Return If(b = 0, a, gcd(b, a Mod b))
End Function
Public Shared Sub Main(ByVal args As String())
Dim a As Integer = 12, b As Integer = 20
Console.WriteLine("The GCD (greatest common divisor) of {0} and {1} is: {2}", a, b, gcd(a, b))
End Sub
End Class
' run
'
' The GCD (greatest common divisor) of 12 and 20 is: 4
'