F# program to check the given number is positive or negative
Program.fs
openSystemConsole.Write("Enter the number ")letn=int32(Console.ReadLine())ifn<0thenprintfn"%i is a negative number"nelifn>0thenprintfn"%i is a positive number"nelseprintfn"Given number is Zero"
Output
codeaft@codeaft:~/fsharp$ dotnet run
Enter the number -0
Given number is Zero
codeaft@codeaft:~/fsharp$ dotnet run
Enter the number -5
-5 is a negative number
codeaft@codeaft:~$
Comments and Reactions
Thank You
Dear User, Thank you for visitng Codeaft. If you are interested in technical articles, latest technologies, and our journey further, please follow us on LinkedIn.