19.4k views
4 votes
Select the correct option that shows a function in F# that receives a list of integers and returns the average value all its elements as a float.

a. let averageList list = List.fold (fun acc elem -> acc + elem) 0 list / float list.Length
b. let averageList list = List.map (fun (acc,elem) -> acc + float elem) 0 list / list.Length
c. let averageList list = List.map (fun acc elem -> acc + elem) 0 list / list.Length
d. let averageList list = List.filter (fun (acc,elem) -> acc + elem) 0.0 list / float list.Length
e. let averageList list = List.fold (fun acc elem -> acc + float elem) 0.0 list / float list.Length

User Suga
by
5.7k points

1 Answer

4 votes

Answer: acc

Step-by-step explanation:

User Cademan
by
5.8k points