Basic input/output syntax

We are now going to see how to write and read in F#. To read and write into the console, we can use the following commands:

  • To write: System.Console.Write("Welcome!")
  • To read: System.Console.Read()
  • To print: printfn "Hello"

Let's compare F# with C#: