Untitled

mail@pastecode.io avatar
unknown
plain_text
a month ago
447 B
2
Indexable
Never
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
Leave a Comment