Untitled

 avatar
unknown
plain_text
a year ago
447 B
7
Indexable
Module Module1

    Function Factorial(ByVal num As Integer) As Integer
        If num >= 1 Then
            Return num * Factorial(num - 1)
        Else
            Return 1
        End If
    End Function
    Sub Main()
        Dim number As Integer = 5
        Dim result As Integer = Factorial(number)
                Console.WriteLine("Factorial of "& number & is: " & result)
        Console.ReadKey()
    End Sub

End Module
Editor is loading...
Leave a Comment