Practice question from FSharp Programming Advanced
What will this code output? A. 15 B. 120 C. 25 D. 5 E. 0
let result =
[1..5]
|> List.fold (fun acc x -> acc * x) 1
printfn "%d" resultAnswer
B
Explanation
List.fold multiplies all elements, so 11234*5 = 120