I am trying to get familiar with C# and tried out the following program - it just outputs the average of the even numbers in the Array.
Would be great if someone could highlight the problem here.
You need select.Average()
(with the parens).
The Missing Parenthesis ()
is the reason for your error.It should be Average()
without a Parenthesis,it is understood as a method group.The average method could have multiple overloads and it is unclear which specific overloaded method needs to be invoked.But when you mention the parenthesis it makes the intention clearer and the method gets called.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With