Quantcast
Viewing latest article 4
Browse Latest Browse All 36

F# Recipe #1 – Display Odd Numbers between 0 and 100 in Console Window

Problem You need to write a F# program to display odd numbers between 0 and 100 in the console window. F# Program to display odd numbers between 0 and 100 in the Console Window. open System let main argv = let mutable sum = 0 for index=0 to 100 do if index%2 <> 0 then sum <- sum + index printfn "sum is %A" sum let ret = Console.ReadLine() 0// Output sum is 2500Image may be NSFW.
Clik here to view.

Viewing latest article 4
Browse Latest Browse All 36

Trending Articles