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
kodingwindow@kw:~/fsharp$ dotnet run
Enter the number -0
Given number is Zero
kodingwindow@kw:~/fsharp$ dotnet run
Enter the number -5
-5 is a negative number
kodingwindow@kw:~$
Comments and Reactions
Advertisement
Thank You
Dear User, Thank you for visitng KodingWindow. If you are interested in technical articles, latest technologies, and our journey further, please follow us on LinkedIn.