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
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
Thank You
Dear User, Thank you for visitng GoDarda. If you are interested in technical
articles, latest technologies, and our journey further, please follow us on LinkedIn.