F# program to find Factorial of a Number
Program
open System
let rec factorial x =
if x <= 1 then 1
else x * factorial(x-1)
Console.Write("Enter the number to get the factorial:\t")
let number = Int32.Parse(Console.ReadLine())
let result= factorial number
Console.WriteLine("Factorial of {0} is {1}\t", number, result)
Output
Enter the number to get the factorial: 8
Factorial of 8 is 40320