F# program to check the given number is even or odd
Program.fs
open System

Console.Write("Enter the number ")
let n = int32(Console.ReadLine())
if(n >= 0) then 
    printfn "%i is an EVEN number" n
else 
    printfn "%i is an ODD number" n
Output
kodingwindow@kw:~/fsharp$ dotnet run
Enter the number 5
5 is an ODD number
kodingwindow@kw:~$ 
Advertisement