This course will become read-only in the near future. Tell us at community.p2pu.org if that is a problem.

Hello World


Your first Hello World Program in F# :

Version 1:

printfn "%s" "Hello World"

Version 2:

You can use existing .NET APIs

System.Console.WriteLine("Hello, World")

Version 3:

Hello World using Windows Form

Step 1:

Add System.Windows.Forms and System.Drawing assembly references by right clicking on reference folder in the solution and the press add reference

Step 2:

open System.Windows.Forms
open System.Drawing; 

let form = new Form(Text = "Hello, World!")
 
let label = new Label(Text = "Hello, World!")
form.Controls.Add(label)
 
Application.Run(form)

Task Discussion