Advertisement
olemis

Edx - F# - Introduction

Nov 5th, 2015
129
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
F# 0.54 KB | None | 0 0
  1. // Learn more about F# at http://fsharp.org
  2. // See the 'F# Tutorial' project for more help.
  3.  
  4. // Indented code available at
  5.  
  6. open System
  7.  
  8. [<EntryPoint>]
  9. let main argv =
  10.     let cylinder r h = Math.PI * r * h
  11.     printfn "Enter radius"
  12.     let value = Console.ReadLine()
  13.     let radius = float value
  14.     printfn "Enter height"
  15.     value = Console.ReadLine()
  16.     let height = float value
  17.     let calc = cylinder radius height
  18.     printfn "%f" calc
  19.     // Wait for user input
  20.     Console.ReadKey()
  21.     0 // return an integer exit code
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement