F# program to check the given number is positive or negative
Program.fs
open System

Console.Write("Enter the number ")
let n = int32(Console.ReadLine())

if n < 0 then printfn "%i is a negative number" n
elif n > 0 then printfn "%i is a positive number" n
else printfn "Given number is Zero"
Output
godarda@gd:~/fsharp$ dotnet run
Enter the number -0
Given number is Zero

godarda@gd:~/fsharp$ dotnet run
Enter the number -5
-5 is a negative number
godarda@gd:~$ 
Comments and Reactions