F# program to perform the arithmetic operations
Program.fs
let a = float32 15f
let b = float32 0f

printfn "———————————————————————————————————————————"
printfn "Program to perform arithmetic operations"
printfn "———————————————————————————————————————————"
printfn "Value of a   | %f " a
printfn "Value of b   | %f " b
printfn "Value of a+b | %f " (a + b)
printfn "Value of a-b | %f " (a - b)
printfn "Value of a*b | %f " (a * b)
printfn "Value of a/b | %f " (a / b)
printfn "Value of a^b | %f " (a ** b)
printfn "———————————————————————————————————————————"
Output
kodingwindow@kw:~/fsharp$ dotnet run
———————————————————————————————————————————
Program to perform arithmetic operations
———————————————————————————————————————————
Value of a   | 15.000000 
Value of b   | 0.000000 
Value of a+b | 15.000000 
Value of a-b | 15.000000 
Value of a*b | 0.000000 
Value of a/b | Infinity 
Value of a^b | 1.000000 
———————————————————————————————————————————
kodingwindow@kw:~$ 
Advertisement