F# program to calculate the area and circumference of a circle
Program.fs
openSystemprintfn"———————————————————————————————————————————"printfn"Program to calculate the area and circumference of a circle"printfn"———————————————————————————————————————————"printf"Enter the radius of a circle "letr=float(Console.ReadLine())printfn"The area of a circle is %f "(Math.PI*r*r)printfn"The circumference of a circle is %f "(float(2)*Math.PI*r)printfn"———————————————————————————————————————————"
Output
kodingwindow@kw:~/fsharp$ dotnet run
———————————————————————————————————————————
Program to calculate the area and circumference of a circle
———————————————————————————————————————————
Enter the radius of a circle 10
The area of a circle is 314.159265
The circumference of a circle is 62.831853
———————————————————————————————————————————
kodingwindow@kw:~$
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.