Imports System.Collections.Generic
Imports System.Linq
Namespace ConsoleApplication1
Class Program
Private Shared Sub Main(args As String())
Dim input As Integer = 10
'Factorial of the number to find
Dim fact As Integer = 1
'a temporary variable to store the intermediate computed values
'the computation
For Each number As var In Enumerable.Range(1, input).ToList()
fact *= number
Next
'display the result
Console.WriteLine("Factorial of {0} is {1}", input, fact)
Console.ReadKey()
End Sub
End Class
End Namespace
Output
-------------
Factorial of 10 is 3628800