+ 1
Why don't these methods work?
"int[ ] arr = { 2, 4, 7, 1}; Console.WriteLine(arr.Max()); //Outputs 7 Console.WriteLine(arr.Min()); //Outputs 1 Console.WriteLine(arr.Sum()); //Outputs 14" These are from the C# SoloLearn tutorial and in the CodePlayground they work. Yet in my IDE throws an error for all three of them.
3 Antworten
+ 2
Min, Max and Sum require Linq extension.
Try to add this
using System.Linq;
+ 1
I use SharpDelevop. Thanks Atomx!
- 1
what kind of error? Are you using Visual Studio?