F# program to print Fibonacci Series using Match With
Program
open System
let rec fibonacci n =
match n with
| 0 | 1 -> 1
| n -> fibonacci (n-1) + fibonacci (n-2)
Console.Write("Enter the number to get the fibonacci series:\t")
let number = Int32.Parse(Console.ReadLine())
let series = fibonacci number
Console.WriteLine("Fibonnaci series of {0} using Match With is {1}\t", number, series);
Output
Enter the number to get the fibonacci series: 7
Fibonnaci series of 7 using Match With is 21