I have an array of ints. I want to get the second highest number in that array. Is there an easy way to do this?
Try this (using LINQ):
int secondHighest = (from number in numbers orderby number descending select number).Skip(1).First();
2.1m questions
2.1m answers
60 comments
57.0k users